Closed diegobas closed 3 days ago
Hey @diegobas
I just tried out with a panel much like yours and it worked fine:
ManagePanelProvider.php:
return $panel
->default()
->id('manage')
->path('manage')
->login(Login::class)
->passwordReset()
->registration()
->viteTheme('resources/css/filament/manage/theme.css')
vite.config.js:
plugins: [
laravel.default({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/manage/theme.css'],
refresh: [
...refreshPaths,
'app/Filament/**',
'app/Forms/Components/**',
'app/Livewire/**',
'app/Infolists/Components/**',
'app/Providers/Filament/**',
'app/Tables/Columns/**',
],
}),
],
resources/css/filament/manage/tailwind.config.js:
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'
export default {
presets: [preset],
content: [
'./app/Filament/Clusters/Products/**/*.php',
'./resources/views/filament/clusters/products/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./vendor/diogogpinto/filament-auth-ui-enhancer/resources/**/*.blade.php',
],
}
Maybe a conflict with another plugin?
https://github.com/user-attachments/assets/a7fae65a-dfa6-46f3-a20d-5c13edf52618
PlpadminPanelProvider:
return $panel
->default()
->id('plpadmin')
->path('plpadmin')
->login()
->databaseNotifications()
->colors([
'primary' => Color::Sky,
'blue' => Color::Blue,
'green' => Color::Green,
'orange' => Color::Orange,
'red' => Color::Red,
'yellow' => Color::Yellow,
'gray' => Color::Gray,
'indigo' => Color::Indigo,
'purple' => Color::Purple,
'pink' => Color::Pink,
'teal' => Color::Teal,
'lime' => Color::Lime,
'emerald' => Color::Emerald,
'cyan' => Color::Cyan
])
->viteTheme('resources/css/filament/plpadmin/theme.css')
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
\App\Filament\Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->plugins([
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make(),
\Jeffgreco13\FilamentBreezy\BreezyCore::make()
->enableSanctumTokens(
permissions: ['create','view','update'] // optional, customize the permissions (default = ["create", "view", "update", "delete"])
)
->myProfile(
shouldRegisterUserMenu: true, // Sets the 'account' link in the panel User Menu (default = true)
shouldRegisterNavigation: false, // Adds a main navigation item for the My Profile page (default = false)
navigationGroup: 'Settings', // Sets the navigation group for the My Profile page (default = null)
hasAvatars: false, // Enables the avatar upload form component (default = false)
slug: 'profile' // Sets the slug for the profile page (default = 'my-profile')
),
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
vite.config.js
import { defineConfig } from 'vite';
import laravel, { refreshPaths } from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/css/filament/plpadmin/theme.css',
'resources/js/app.js'
],
refresh: [
...refreshPaths,
'app/Livewire/**'
],
}),
],
});
resources/css/filament/plpadmin/tailwind.config.js:
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'
export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./resources/views/components/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./vendor/awcodes/filament-tiptap-editor/resources/**/*.blade.php',
'./vendor/diogogpinto/filament-auth-ui-enhancer/resources/**/*.blade.php',
],
}
I will replicate your workflow and see what’s causing this!
I just replicated all the your code and it's working fine, with no issues. Here's my step by step:
php artisan make:filament-panel
and name it plpadminphp artisan make:filament-theme
and select the plpadmin panel<?php
namespace App\Providers\Filament;
use DiogoGPinto\AuthUIEnhancer\AuthUIEnhancerPlugin;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
class PlpadminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('plpadmin')
->path('plpadmin')
->login()
->databaseNotifications()
->colors([
'primary' => Color::Sky,
'blue' => Color::Blue,
'green' => Color::Green,
'orange' => Color::Orange,
'red' => Color::Red,
'yellow' => Color::Yellow,
'gray' => Color::Gray,
'indigo' => Color::Indigo,
'purple' => Color::Purple,
'pink' => Color::Pink,
'teal' => Color::Teal,
'lime' => Color::Lime,
'emerald' => Color::Emerald,
'cyan' => Color::Cyan,
])
->viteTheme('resources/css/filament/plpadmin/theme.css')
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
\App\Filament\Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
])
->plugins([
\BezhanSalleh\FilamentShield\FilamentShieldPlugin::make(),
\Jeffgreco13\FilamentBreezy\BreezyCore::make()
->enableSanctumTokens(
permissions: ['create', 'view', 'update'] // optional, customize the permissions (default = ["create", "view", "update", "delete"])
)
->myProfile(
shouldRegisterUserMenu: true, // Sets the 'account' link in the panel User Menu (default = true)
shouldRegisterNavigation: false, // Adds a main navigation item for the My Profile page (default = false)
navigationGroup: 'Settings', // Sets the navigation group for the My Profile page (default = null)
hasAvatars: false, // Enables the avatar upload form component (default = false)
slug: 'profile' // Sets the slug for the profile page (default = 'my-profile')
),
AuthUIEnhancerPlugin::make(),
])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
}
}
import { defineConfig } from 'vite'
import laravel, { refreshPaths } from 'laravel-vite-plugin'
export default defineConfig({
plugins: [
laravel.default({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/plpadmin/theme.css'],
refresh: [
...refreshPaths,
'app/Filament/**',
'app/Forms/Components/**',
'app/Livewire/**',
'app/Infolists/Components/**',
'app/Providers/Filament/**',
'app/Tables/Columns/**',
],
}),
],
})
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'
export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
'./vendor/awcodes/filament-tiptap-editor/resources/**/*.blade.php',
'./vendor/diogogpinto/filament-auth-ui-enhancer/resources/**/*.blade.php',
],
}
npm run build
I'm closing this for now, because as this is probably a misconfiguration on your end. If you can create a repo that mimics that behaviour and I clone to my machine to test it out, please reopen this issue.
Thank you, let me know if I can help further!
Problem solved!
I had to remove the file "bootstrap/cache/filament/panels/plpadmin.php" because "php artisan cache:clear" did not.
Thank you for your help and your great work!
Thank you for you feedback @diegobas and kind words!
What happened?
When you define your panel id to something different from 'admin' the login action gives this error:
How to reproduce the bug
It works when panel ID is 'admin'
Package Version
1.0.1
PHP Version
8.3
Laravel Version
11.29.0
Which operating systems does with happen with?
Linux
Notes
No response