JohnnyC
JohnnyC
FFilament
Created by JohnnyC on 10/5/2023 in #❓┊help
Action : Modal don't show
I use Filament Panel. When I click on Action button, livewire update request is runing but modal doesn't show. This my Widget :
<?php

namespace App\Filament\Widgets\SessionPlanning;

use Filament\Actions;
use Filament\Forms;
use Filament\Widgets\Widget;

class SessionOverview extends Widget implements Forms\Contracts\HasForms, Actions\Contracts\HasActions
{
use Forms\Concerns\InteractsWithForms, Actions\Concerns\InteractsWithActions;

protected static string $view = 'filament.widgets.session-planning.session-overview';

public function createWorkout(): Actions\Action
{
return Actions\Action::make('createWorkout')
->form([
Forms\Components\Select::make('workout')
->options([
'bench_press' => 'Bench Press',
])
->label('Workout')
->required(),
]);
}
}
<?php

namespace App\Filament\Widgets\SessionPlanning;

use Filament\Actions;
use Filament\Forms;
use Filament\Widgets\Widget;

class SessionOverview extends Widget implements Forms\Contracts\HasForms, Actions\Contracts\HasActions
{
use Forms\Concerns\InteractsWithForms, Actions\Concerns\InteractsWithActions;

protected static string $view = 'filament.widgets.session-planning.session-overview';

public function createWorkout(): Actions\Action
{
return Actions\Action::make('createWorkout')
->form([
Forms\Components\Select::make('workout')
->options([
'bench_press' => 'Bench Press',
])
->label('Workout')
->required(),
]);
}
}
And my widget view :
<x-filament-widgets::widget>
{{ $this->createWorkout }}
</x-filament-digets::widget>
<x-filament-widgets::widget>
{{ $this->createWorkout }}
</x-filament-digets::widget>
And i have no error. Have you an idea to resolve it ? Thank you
6 replies
FFilament
Created by JohnnyC on 8/3/2023 in #❓┊help
Call auth()->user() from NavigationItems
With Filament V2 I could do that :
Filament::serving(function () {
Filament::registerNavigationItems(
auth()->user()?->groups->map(function ($group) {
return NavigationItem::make($group->name)
->group('Group'))
// ...;
})->toArray() ?? []
);
Filament::serving(function () {
Filament::registerNavigationItems(
auth()->user()?->groups->map(function ($group) {
return NavigationItem::make($group->name)
->group('Group'))
// ...;
})->toArray() ?? []
);
And dynamic items based on authenticated user was generated. But with FIlament v3, i haven't access to auth()->user() or $panel->auth()->use() because it's always null. I know that I have to pass with callback function, but $panel->navigationItems() doesn't allow callback. I tried with $panel->navigation() but all my menu is override and it doesn't work. Have you any idea ?
15 replies
FFilament
Created by JohnnyC on 4/19/2023 in #❓┊help
Use another client that Pusher with Websocket
I would like to use Soketi for websocket (database notification) on Admin Panel but I can't. Everything is well configured on Laravel (on my not-filament application it is ok). The configuration :
'database_notifications' => [
'enabled' => true,
'polling_interval' => null,
'trigger' => 'notifications.database-notifications-trigger',
],

'broadcasting' => [

'echo' => [
'broadcaster' => 'pusher',
'key' => env('VITE_PUSHER_APP_KEY'),
'cluster' => env('VITE_PUSHER_APP_CLUSTER'),
'forceTLS' => true,
],

],
'database_notifications' => [
'enabled' => true,
'polling_interval' => null,
'trigger' => 'notifications.database-notifications-trigger',
],

'broadcasting' => [

'echo' => [
'broadcaster' => 'pusher',
'key' => env('VITE_PUSHER_APP_KEY'),
'cluster' => env('VITE_PUSHER_APP_CLUSTER'),
'forceTLS' => true,
],

],
But, Pusher persist on Admin Panel : wss://ws-mt1.pusher.com/app/app-key?protocol=7&client=js&version=7.6.0&flash=false Can you help me please ?
10 replies