F
Filament4mo ago
Stfn

Headeraction bug? Or am i stupid

https://gyazo.com/96225f66cd0dade6368ca9cfc940508e This recording is just to show the "bug" Basicly, the button works, if i then refresh the page, it will show the opposite text, than it is showing, then i have to click it twice, to get it to work with the list again..
->headerActions([
Action::make('toggleView')
->label(session('view_all_networks', True) ? 'All Networks' : 'My Networks')
->visible(Auth::user()->is_admin) // Only visible for admins
->action(function () {
$viewAll = session('view_all_networks', false);
session(['view_all_networks' => !$viewAll]);



Notification::make()
->title('View toggled successfully.')
->success()
->send();
}),
]);
->headerActions([
Action::make('toggleView')
->label(session('view_all_networks', True) ? 'All Networks' : 'My Networks')
->visible(Auth::user()->is_admin) // Only visible for admins
->action(function () {
$viewAll = session('view_all_networks', false);
session(['view_all_networks' => !$viewAll]);



Notification::make()
->title('View toggled successfully.')
->success()
->send();
}),
]);
This is the code, i dont see the issue?`Would i be able to change a header instead? and use that to inform what list the person is on?
1 Reply
Stfn
StfnOP4mo ago
Bump
Want results from more Discord servers?
Add your server