add circle component and small circle percentage

This commit is contained in:
arifal
2025-02-04 01:12:33 +07:00
parent c43c79f65e
commit 6e726b4940
7 changed files with 483 additions and 20 deletions

View File

@@ -2,6 +2,8 @@
namespace App\Providers;
use App\View\Components\Circle;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Carbon\Carbon;
@@ -20,6 +22,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
Blade::component('circle', Circle::class);
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Circle extends Component
{
public $document_title;
public $document_color;
public $document_type;
public $document_id;
public $visible_small_circle;
public function __construct($document_id = "",$document_title = "", $document_type = "", $document_color = "#020c5c", $visible_small_circle = true)
{
$this->document_title = $document_title;
$this->document_color = $document_color;
$this->document_type = $document_type;
$this->document_id = $document_id;
$this->visible_small_circle = $visible_small_circle;
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.circle');
}
}