pace
It's possible change the "default title" for all tabs?
Currently filament show the (of the tab) title using this code in layout/base.blade.php:
But I need to change that and show the brandname before:
How can I change ( in a safe way ) this file? I can create some view to override? Or have another solution? But I don't think override the base file is a good idea.
3 replies
Handling Users with No Permissions
I am using Filament Shield to allow the admin to manage user roles and permissions. However, after login, if a user doesn't have permission to access any resources, no 403 error message is displayed, and the user is redirected in an infinite loop to /admin.
What I want to achieve is to show a 403 error page when the user doesn't have permission to access any resources.
I attempted to create a middleware to check if the user has access to any menu items:
However, when this middleware is invoked, the NavigationManager doesn’t return any items, regardless of the user's permissions. It seems that the NavigationManager might not be booted or loaded at this point.
How can I ensure the navigation items are loaded before the middleware runs? Or is there another solution to handle this issue? Any advice would be greatly appreciated. Thanks!
2 replies
How to use a parameter to change a resource table query?
I am working with :
FolderResource
and AccessLinkResource
.
An AccessLink
belongs to an Folder
. And Folder
have many AccessLinks
.
I am trying to create a AccessLinkResource
which show and create the records using the folder_id
.
The first step is filter the records of AccessLinkResource
table using the folder_id
.
To do that, i created a button in FolderResource
:
And i used the modifyQueryUsing
in AccessLink
table:
It works in the first load of the page, but when use the pagination return no records.
What it is the correct way to handle this? How can I use the $folder_id param in a static method?3 replies
Trying to test a form but error: Attempt to read property "form" on null
I am following the docs and i tried to test a form with this code ( PHPUnit ):
use App\Filament\Resources\UserResource\Pages\CreateUser;
use Livewire\Livewire;
public function test_if_valid_user_can_create_user(): void
{
$newData = User::factory()->make();
Livewire::test(CreateUser::class)
->fillForm([
'name' => $newData->name,
'email' => $newData->email,
'password' => 'password',
'password_confirmation' => 'password',
])
->call('create')
->assertHasNoErrors();
}
But it is returning the error: Attempt to read property "form" on null.
Is this livewire/livewire import right?3 replies
Use fa-icon in table builder
I'm working in a project who already have a database in production.
The database have a table with a column called icon. The icon column have values like: <i class="fas fa-hard-hat"></i>
I need to span this icons in a table. It's possible do that?
Because when i tried to add ->html() to the TextForm, the cell become empty.
I already tried to install the owenvoke/blade-fontawesome package
2 replies