for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xetaravel\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Checkbox extends Component
{
public string $uuid;
public function __construct(
public ?string $id = null,
public ?string $label = null,
public ?bool $right = false,
public ?string $hint = null,
public ?string $hintClass = 'fieldset-label',
// Validations
public ?string $errorField = null,
public ?string $errorClass = 'text-error',
public ?bool $omitError = false,
public ?bool $firstErrorOnly = false,
) {
$this->uuid = md5(serialize($this)) . $id;
}
public function modelName(): ?string
return $this->attributes->whereStartsWith('wire:model')->first();
public function errorFieldName(): ?string
return $this->errorField ?? $this->modelName();
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
return view('components.checkbox');