Max
Max
Explore posts from servers
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
That fixed it! Thanks!
23 replies
FFilament
Created by Max on 7/3/2024 in #❓┊help
add requiresConfirmation to save action on Edit - Resource
This works for the create form but I cannot find an equivilant for the edit form acction
14 replies
FFilament
Created by Max on 7/3/2024 in #❓┊help
add requiresConfirmation to save action on Edit - Resource
Still not working :/
14 replies
FFilament
Created by Max on 7/3/2024 in #❓┊help
add requiresConfirmation to save action on Edit - Resource
14 replies
FFilament
Created by Max on 7/3/2024 in #❓┊help
add requiresConfirmation to save action on Edit - Resource
No description
14 replies
FFilament
Created by Max on 7/3/2024 in #❓┊help
add requiresConfirmation to save action on Edit - Resource
Same question in <#1098265690588319754> never answered
14 replies
FFilament
Created by Max on 7/3/2024 in #❓┊help
add requiresConfirmation to save action on Edit - Resource
Tried this without any luck
14 replies
FFilament
Created by Max on 7/3/2024 in #❓┊help
add requiresConfirmation to save action on Edit - Resource
No description
14 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
There also both rendering cache action
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
No description
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
I did
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
Yeah they are :/
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
No description
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
No description
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
it works when I have only one action but as soon as I make more than one it breaks complertly
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
Ok cool thanks, now im getting This action does not belong to a Livewire component.
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
No description
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
class HeaderActions extends Component implements HasActions, HasForms
{
use InteractsWithActions;
use InteractsWithForms;

public function render()
{
return view('livewire.header-actions');
}

public function deleteAction(): Action
{
return Action::make('delete 2')
->requiresConfirmation()
->action(fn () => dd('delete user'));
}

public function cacheAction(): Action
{
return Action::make('Flush Cache')
->action(function (): void {
$this->flushCache();
})
->label('Flush Cache')
->requiresConfirmation()
->modalHeading('Flush Cache')
->modalDescription('Are you sure you want to flush the cache? This will clear all cached data.')
->modalSubmitActionLabel('Flush Cache');
}

public function flushSessionsAction(): Action
{
return Action::make('Flush Sessions')
->action(function (): void {
$this->flushSessions();
})
->requiresConfirmation()
->label('Flush Sessions')
->modalHeading('Flush Sessions')
->modalDescription('Are you sure you want to flush all sessions?')
->modalSubmitActionLabel('Flush Sessions');
}

protected function flushCache(): void
{
Redis::connection()->flushdb();
Notification::make()
->title('Cache Flushed')
->body('Cache has been flushed successfully.')
->success()
->send();

// Redirect to the dashboard
return redirect()->route('dashboard');
}

protected function flushSessions(): void
{
Redis::connection()->flushdb();
Notification::make()
->title('Sessions Flushed')
->body('Sessions have been flushed successfully.')
->success()
->send();
}
}
class HeaderActions extends Component implements HasActions, HasForms
{
use InteractsWithActions;
use InteractsWithForms;

public function render()
{
return view('livewire.header-actions');
}

public function deleteAction(): Action
{
return Action::make('delete 2')
->requiresConfirmation()
->action(fn () => dd('delete user'));
}

public function cacheAction(): Action
{
return Action::make('Flush Cache')
->action(function (): void {
$this->flushCache();
})
->label('Flush Cache')
->requiresConfirmation()
->modalHeading('Flush Cache')
->modalDescription('Are you sure you want to flush the cache? This will clear all cached data.')
->modalSubmitActionLabel('Flush Cache');
}

public function flushSessionsAction(): Action
{
return Action::make('Flush Sessions')
->action(function (): void {
$this->flushSessions();
})
->requiresConfirmation()
->label('Flush Sessions')
->modalHeading('Flush Sessions')
->modalDescription('Are you sure you want to flush all sessions?')
->modalSubmitActionLabel('Flush Sessions');
}

protected function flushCache(): void
{
Redis::connection()->flushdb();
Notification::make()
->title('Cache Flushed')
->body('Cache has been flushed successfully.')
->success()
->send();

// Redirect to the dashboard
return redirect()->route('dashboard');
}

protected function flushSessions(): void
{
Redis::connection()->flushdb();
Notification::make()
->title('Sessions Flushed')
->body('Sessions have been flushed successfully.')
->success()
->send();
}
}
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
No description
23 replies
FFilament
Created by Max on 6/30/2024 in #❓┊help
Header actions on AdminPanel dashboard
Really I only need it to look like an action and behave by running custom code
23 replies