Files
2025-07-24 16:18:27 +07:00

30 lines
632 B
PHP

<?php
namespace App\View\Components\Input;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class InputSwitch extends Component
{
public $name;
public $value;
public $checked;
public function __construct($name = '', $value = '', $checked = false)
{
$this->name = $name;
$this->value = $value;
$this->checked = filter_var($checked, FILTER_VALIDATE_BOOLEAN);
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.input.switch');
}
}