Jacko
Jacko
FFilament
Created by Jacko on 10/19/2023 in #❓┊help
Filament Fabricator, return object from select field
Hey, I'm new to Filament/Laravel so sorry for the noob Q - I'm trying to create a CMS type back-end for a website. I have a model called "Machine" and each machine should be capable of having an associated public page. Is there a way in fabricator to return a machine object to the blade file, as opposed to just the ID, when using a select field in the block with all machines listed.
return Block::make('machine')
->schema([
TextInput::make('name'),
Select::make('machine_id')
->label('Machine')
->options(\App\Models\Machine::pluck('name', 'id')->toArray())
]);
return Block::make('machine')
->schema([
TextInput::make('name'),
Select::make('machine_id')
->label('Machine')
->options(\App\Models\Machine::pluck('name', 'id')->toArray())
]);
$machineId works in the block template but I want to have access to the full machine object. Thanks
3 replies