slooffmaster
slooffmaster
FFilament
Created by leoblanski on 12/22/2023 in #❓┊help
Edit page as Index resource page
Late to the party but I found a solution to this question/challenge. In the Resource file I changed the getPages() method to this:
public static function getPages(): array
{
return [
// 'index' => Pages\ListThings::route('/'),
// 'create' => Pages\CreateThings::route('/create'),
// 'edit' => Pages\EditThings::route('/{record}/edit'),
'index' => Pages\EditThings::route('/'),
];
}
public static function getPages(): array
{
return [
// 'index' => Pages\ListThings::route('/'),
// 'create' => Pages\CreateThings::route('/create'),
// 'edit' => Pages\EditThings::route('/{record}/edit'),
'index' => Pages\EditThings::route('/'),
];
}
Then in the EditThings class I defined the mount() method like so:
public function mount(string|int $record = null): void
{
// then do whatever you need to get the record you wish to edit
$this->record = $whatever_you_need;

parent::mount($this->record->getKey());
}
public function mount(string|int $record = null): void
{
// then do whatever you need to get the record you wish to edit
$this->record = $whatever_you_need;

parent::mount($this->record->getKey());
}
The trick is to assign a default value of null to the required parameter.
4 replies
FFilament
Created by lazydog on 2/9/2024 in #❓┊help
Broken Login Page
Make sure you run npm run build , also sometime this can be caused by serving mixed content (http/https). In both cases your browser developer will show some hints.
11 replies
FFilament
Created by slooffmaster on 9/15/2023 in #❓┊help
Dark/Light mode logo
OK, understood. I'd initially played around with those classes without success. I now understand why.
7 replies