How to render the blade file in the /resources/views/vendor/laravelusers/usersmanagement folder
quocanh261997 opened this issue · comments
Hi, somehow, when I try to render these blade files, it's saying that a variable that's called "rolesEnabled" not defined, and so returning errors. Is there documentation somewhere saying:
- What are the necessary fields needed to render these fields
- What values and from what sources are we getting those values for those above fields to render the blade file
Thank you very much!!
You need to publish the config and set the env variables to use it not use the separate roles package
I've already published the config, and it's already showing the laravelusers.php
in config
folder, but it's still showing the error
I don’t know, i cannot replicate the issue
Do I need to run php artisan vendor:publish --tag=laravelusers
everytime I change something in the laravelusers.php
file? The way that I'm rendering the create-user.blade.php
file is by defining this route:
Route::get('/create-user', function() {
return view('vendor.laravelusers.usersmanagement.create-user');
});
You shouldn’t need to. All those settings have been ported to env variables.
If you have your configs cached you may need to clear that.
They you are implementing it not as it’s intended design and some data may be missing.
You have to use the built in routes and if you want to use that route you may need to create a redirect to the correct route.
Trying to go to the view directly with a closure will not work. It needs to run through the controller and attach the needed data.
Where are the built in routes
implemented? I don't see it anywhere in the folder after installing the package
They get picked up by the auto loader and just appear
https://github.com/jeremykenedy/laravel-users/blob/master/src/LaravelUsersServiceProvider.php#L35