F
Filament5mo ago
o.m

How do I create a child of a page?

Is is possible to create a custom child page? The notifications/ is the parent, and is also a custom page /notifications/{slug}/edit
No description
3 Replies
o.m
o.mOP5mo ago
I added a code getPages() like this
public static function getPages(): array
{
return [
'edit' => EditNotification::route('/{slug}/edit'),
];
}
public static function getPages(): array
{
return [
'edit' => EditNotification::route('/{slug}/edit'),
];
}
o.m
o.mOP5mo ago
I get this error after following this documentation https://filamentphp.com/docs/3.x/panels/resources/custom-pages
No description
o.m
o.mOP5mo ago
I am not 100% sure whats the right way of doing it. I have a Custom page called EditNotification and Notification and I wanted EditNotification page to be only accessible using that {slug}/edit route. The notification page will be the main page for handling the custom view (table), where it will redirect EditNotification and display specific data that came from Notification page Or if you think theres a better way of approaching this such as modal, it is okay with me Forgot to include the code but this is where I wanted to call the modal at the a tag
@foreach ($this->tableData()->items() as $notification)
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-400 hover:underline">
<a href="{{ $notification['slug'] }}/edit"/>{{ $notification['label'] }}</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-white">
{{ $notification['type'] }}
</td>
</tr>
@endforeach
@foreach ($this->tableData()->items() as $notification)
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-blue-400 hover:underline">
<a href="{{ $notification['slug'] }}/edit"/>{{ $notification['label'] }}</a>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-white">
{{ $notification['type'] }}
</td>
</tr>
@endforeach

Did you find this page helpful?