Rick Doetinchem
Rick Doetinchem
FFilament
Created by Rick Doetinchem on 12/24/2024 in #❓┊help
Relational data in Infolist is not shown
No description
4 replies
FFilament
Created by Rick Doetinchem on 12/24/2024 in #❓┊help
Richeditor undefined error
No description
5 replies
FFilament
Created by Rick Doetinchem on 12/20/2024 in #❓┊help
Grid columns on pagelevel
No description
3 replies
FFilament
Created by Rick Doetinchem on 12/18/2024 in #❓┊help
Fetch relational data in custom page
How can I fetch the relational data in personable.full_name? public function form(Form $form): Form { return $form ->schema([ TextInput::make('title') ->autofocus() ->required(), TextInput::make('personable.full_name') ->required(), ]) ->statePath('data') ->model($this->ticket); } public Ticket $ticket; public function mount(int | string $record): void { $this->ticket = Ticket::findOrFail($record); $this->form->fill($this->ticket->attributesToArray()); } User.php model: public function tickets(): MorphMany { return $this->morphMany(Ticket::class, 'personable'); } Ticket.php model: public function personable(): MorphTo { return $this->morphTo(); }
8 replies
FFilament
Created by Rick Doetinchem on 12/17/2024 in #❓┊help
Custom page with resource record error
I have a custom page: public static function getPages(): array { return [ 'ticketWithComments' => Pages\TicketWithComments::route('/{ticketId}/ticketwithcomments'), … ]; } And I try to pickup the ticketId and fill the form with the following code: public function mount($ticketId): void { $this->ticket = Ticket::findOrFail($ticketId); $this->form->fill($this->ticket->attributesToArray()); } But I’m getting error: Typed property App\Filament\App\Resources\TicketResource\Pages\TicketWithComments::$ticket must not be accessed before initialization What am I doing wrong?
21 replies