<?php
namespace App\Livewire\Registry;
class FindRegistry extends Widget implements HasSchemas, HasActions
{
use InteractsWithSchemas,
InteractsWithActions;
protected string $view = 'livewire.registry.find-registry';
public ?int $registryId = null;
public function mount(): void
{
$this->registryId = auth()->user()?->preferred_registry_id;
}
public function findRegistryAction(): Action
{
$label = is_null($this->registryId) ? 'Find a registry' : 'Modify registry';
return Action::make('find_registry')
->label($label)
->icon(Heroicon::PencilSquare)
->iconPosition(IconPosition::After)
->link()
->schema([
TextInput::make('geocode')
->label('Search via postal code, address, or city')
->suffixAction(
Action::make('use_current_location')
->label('Use current location')
->icon(Heroicon::MapPin)
->iconPosition(IconPosition::After),
)
]);
}
}
<?php
namespace App\Livewire\Registry;
class FindRegistry extends Widget implements HasSchemas, HasActions
{
use InteractsWithSchemas,
InteractsWithActions;
protected string $view = 'livewire.registry.find-registry';
public ?int $registryId = null;
public function mount(): void
{
$this->registryId = auth()->user()?->preferred_registry_id;
}
public function findRegistryAction(): Action
{
$label = is_null($this->registryId) ? 'Find a registry' : 'Modify registry';
return Action::make('find_registry')
->label($label)
->icon(Heroicon::PencilSquare)
->iconPosition(IconPosition::After)
->link()
->schema([
TextInput::make('geocode')
->label('Search via postal code, address, or city')
->suffixAction(
Action::make('use_current_location')
->label('Use current location')
->icon(Heroicon::MapPin)
->iconPosition(IconPosition::After),
)
]);
}
}