Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filament 3 install plaguns in authMiddleware #23

Closed
POMXARK opened this issue Jun 6, 2024 · 2 comments
Closed

filament 3 install plaguns in authMiddleware #23

POMXARK opened this issue Jun 6, 2024 · 2 comments

Comments

@POMXARK
Copy link

POMXARK commented Jun 6, 2024

filament 3 install plaguns in authMiddleware

@adrolli
Copy link
Member

adrolli commented Jun 6, 2024

Hello Pomxark,
I understand the concern.

The package provides an install-command that automatically registers the Filament resource in the AdminPanelProvider. However, if you do have a custom AdminPanelProvider, you are able to register it manually wherever you want.

To provide access control for your Filament panel, you could register the middleware within the FilamentPanelProvider like this:

namespace App\Providers;

use Filament\Facades\Filament;
use Illuminate\Support\ServiceProvider;

class FilamentPanelProvider extends ServiceProvider
{
    public function boot()
    {
        Filament::serving(function () {
            Filament::registerMiddleware([
                \App\Http\Middleware\Authenticate::class,
            ]);
        });
    }
}

Would you prefer an option to make the auth middleware configurable in the package? If you have a specific use case or example, could you provide more details or create a PR?

Cheers,
Alf

@adrolli
Copy link
Member

adrolli commented Aug 28, 2024

Closing due to inactivity. Please make a new issue, if there are further questions.

@adrolli adrolli closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants