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

having two different routes to laravel elfinder? #331

Open
prescriptionlifeline opened this issue Mar 16, 2024 · 0 comments
Open

having two different routes to laravel elfinder? #331

prescriptionlifeline opened this issue Mar 16, 2024 · 0 comments

Comments

@prescriptionlifeline
Copy link

On my Laravel site I have two different types of users - admins and non-admin. Both admins and non admins can view
certain pages but there are other pages that only admins can view.

For the Admin pages I'm using Laravel Backpack with backpack/filemanager, which in turn, is a thin wrapper around this project. Like I want admins to be able to upload files but I do not want non admins uploading files.

To facilitate this what I was thinking I could do is to have two separate instances of Laravel Elfinder. The one that backpack/filemanager created and another one for non-admins. On the non-admin one I was thinking I'd prevent uploads by hiding the buttons / menu options that give the ability to do uploads. Maybe there are better methods to prevent people from uploading files but if I can't have two separate instances of Laravel Elfinder then there's no point in pursuing those other options.

Anyway, the problem with my approach is that I already have a config/elfinder.php. backpack/filemanager created it and that one already defines a route:

    'route' => [
        'prefix' => config('backpack.base.route_prefix', 'admin').'/elfinder',
        'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], //Set to null to disable middleware filter
    ],

Like from that it's unclear to me how I could have two separate routes for two separate laravel-elfinder instances, if that's even possible at all.

I suppose I could create two Laravel instances and use mod_proxy_http to make it so that requests to /admin are served up from one Laravel instance and requests to everything else are served up via another Laravel instance but that has challenges of its own and I'd rather not do that! I suppose another possibility would be to use a completely different file manager for the non-admin one (maybe alexusmai/laravel-file-manager) but idk... I'm already using laravel elfinder and would prefer to re-use it!

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

1 participant