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

A fix for "Target class [web] does not exist." and an update to the Demo to work with custom url_prefix and middlewares #1026

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

drhootch
Copy link

Summary of the change:

Issue 1:

if (config('lfm.use_package_routes')) is true then a route with prefix 'filemanger' and middleware ['web','auth’] is applied
in this case if the user doesn’t have web middleware he will get Target class [web] does not exist. error.

The suggested solution:

this can be fixed by adding middlewares array in config, if present it will take the values or fallback to ['web','auth’]
making the prefix variable is also preferable by adding url_prefix, so if url_prefix is present in config the route will take that value, else it will fallback to filemanager

Issue 2:

The demo is using /filemanger route, but in case the user creates custom route with prefix different than /filemanger (and sets the lfm.use_package_routes to false) the demo will no longer work because it will not find any route named /filemanger

The suggested solution:

This can be fixed by initializing the variable route_prefix in the demo view with the url_prefix value from config if present, then fallback to /filemanager if no value is present

Recap:

Optional url_prefix and middlewares are added to config file, so in case of use_package_routes is true, the route generated will try to get prefix value and middleware array from config file before falling back to static values.
Also if the user creates a route with a custom prefix, he can set that prefix in config, so it will be used in the demo without failing if use_package_routes is false.

Ishak Amri added 3 commits January 17, 2021 16:49
…ll try to get prefix value and middleware array from config file before falling back to static values.
…to static value '/filemanager'.

-ckeditor click function : replacing '/filemanager' with route_prefix (already declared variable)
…to get prefix value and middleware array from config file before falling back to static values.

-If the user creates a route with a custom prefix, he can set the prefix in config to be used in demo.
@drhootch drhootch changed the title Package routes update A fix for "Target class [web] does not exist." and an update to the Demo to work with custom url_prefix and middlewares Jan 18, 2021
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

Successfully merging this pull request may close these issues.

1 participant