Akki
Akki
FFilament
Created by Akki on 4/1/2025 in #❓┊help
Restrict non filament panel user, accessing filament admin panel.
This one is my AdminPanelProvider Login code public function panel(Panel $panel): Panel { return $panel ->default() ->id('admin') ->path('admin') ->login() ->colors([ 'primary' => Color::Sky, ]) ->topNavigation() ->login(false) ->emailVerification() ->databaseNotifications() ->unsavedChangesAlerts() ->userMenuItems($this->getUserMenuItems()) ->brandLogo(asset('/img/logo-minimal.svg')) ->darkModeBrandLogo(asset('/img/logo-minimal-dark.svg')) ->brandLogoHeight('2.5rem') ->favicon(asset('/favicon.svg')) ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') ->pages([Pages\Dashboard::class]) ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') ->widgets($this->getWidgets()) ->middleware($this->getMiddleware()) ->authMiddleware([Authenticate::class]); } Thing is if i put validation over here for re-direct normal user like below one Filament::serving(function () { if (Filament::getCurrentPanel()) { // This block runs only if the request is from a Filament panel dd('Filament User:', Filament::auth()->user()); } else { // This block runs if the request is NOT from a Filament panel return Redirect::route('home'); } } When i login using admin it gives dd with auth user id but when i login using normal user, it doesn't recognize Filament:: class and gives 403 forbidden error
8 replies
FFilament
Created by Akki on 4/1/2025 in #❓┊help
Restrict non filament panel user, accessing filament admin panel.
🎯 In providers i have below providers listed as per the sequence return [ App\Providers\AppServiceProvider::class, App\Providers\Filament\AdminPanelProvider::class, App\Providers\FortifyServiceProvider::class, App\Providers\HorizonServiceProvider::class, App\Providers\JetstreamServiceProvider::class, ];
8 replies
FFilament
Created by Akki on 4/1/2025 in #❓┊help
Restrict non filament panel user, accessing filament admin panel.
The first is that i am using laravel 11, so i dont have any kernal.php, i need to depend on AppServiceProvider. my function is as below: public function boot(): void { Model::unguard(); Feature::resolveScopeUsing(fn($driver) => Auth::user()?->currentTeam); Feature::discover(); Gate::policy(AConnectLoan::class, AConnectLoanPolicy::class); Gate::define('superadmin', function (User $user) { return in_array($user->email, [ '[email protected]', ]); }); FilamentColor::register([ 'danger' => Color::Red, 'primary' => Color::Sky, 'success' => Color::Green, 'warning' => Color::Amber, ]); DatabaseNotifications::trigger('filament.notifications.database-notifications-trigger'); DatabaseNotifications::pollingInterval('30s'); Password::defaults(function () { return Password::min(14) ->mixedCase() ->numbers() ->symbols() ->uncompromised(); }); // Add the blameable macro to all blueprints Blueprint::macro('blameable', function () { (new BlameableService())->addBlameableColumns($this->getTable()); }); Validator::extend('cat_email', function ($attribute, $value, $parameters, $validator) { $rule = new CatEmailValidator(); // Call the validate method, passing the $fail closure $rule->validate($attribute, $value, function ($message) use ($validator, $attribute) { $validator->errors()->add($attribute, $message); }); return true; }); }
8 replies
FFilament
Created by Akki on 2/19/2025 in #❓┊help
Xls Export Set Column Width
any third party package which we can use along with filament?
5 replies
FFilament
Created by Akki on 2/19/2025 in #❓┊help
Xls Export Set Column Width
So you mean to say that there is no functionality to customize excel sheet column-size, font-size, font-color in filamnet?
5 replies
FFilament
Created by Akki on 2/10/2025 in #❓┊help
multi file upload with total size limit
No description
5 replies
FFilament
Created by Akki on 2/10/2025 in #❓┊help
multi file upload with total size limit
Thanks for the quick response but this is not working on my way end.
5 replies