mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
27 lines
617 B
PHP
27 lines
617 B
PHP
<?php
|
|
|
|
namespace App\Web\Components;
|
|
|
|
use Illuminate\Contracts\Support\Htmlable;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\View\Component;
|
|
|
|
class Link extends Component implements Htmlable
|
|
{
|
|
public function __construct(public string $href, public string $text, public bool $external = false) {}
|
|
|
|
public function render(): View
|
|
{
|
|
return view('components.link');
|
|
}
|
|
|
|
public function toHtml(): View|string
|
|
{
|
|
return $this->render()->with([
|
|
'href' => $this->href,
|
|
'text' => $this->text,
|
|
'external' => $this->external,
|
|
]);
|
|
}
|
|
}
|