thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.73k stars 2.67k forks source link

Voyager default database name can not fetched with laravel 6 #4757

Closed skydev2020 closed 4 years ago

skydev2020 commented 4 years ago

Version information

Description

After fresh install of Laravel 6, again installed Voyager following the guidelines. And I updated the DB_DATABASE = but it keeps connecting with 'laravel'

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install Laravel 6.2 (Latest as of today)
  2. Update .env file: DB_DATABASE =
  3. Install Voyager 1.3 (Latest as of today)
  4. php artisan serve php artisan serve And, visit the URL http://localhost:8000/admin in your browser.
  5. See error Facade\Ignition\Exceptions\ViewException SQLSTATE[HY000] [1049] Unknown database 'laravel' (View: D:\xampp\htdocs\learnon\vendor\tcg\voyager\resources\views\login.blade.php) http://127.0.0.1:8000/admin/login

Expected behavior

Screenshots

If applicable, add screenshots to help explain your problem. image

Additional context

Add any other context about the problem here.

fletch3555 commented 4 years ago

Voyager definitely doesn't hard-core the database name anywhere, so my guess is that you have cached configs. Please run artisan config:clear

skydev2020 commented 4 years ago

Thanks for your answer @fletch3555 . I have one more question. How can I use Voyager admin panel to allow all users to login but with limited features/menus? I want to build a app where every user can login but limited menus/features.

fletch3555 commented 4 years ago

Assign your users to a role that has the browse_admin permission and they'll be able to log into Voyager. The rest of their access is determined by the other permissions assigned to that role.

Under the hood, Voyager just uses Laravel's auth system (specifically policies). So you can tie into that with any customizations you need to make. New permissions are stored in the database in case you need to create anything custom. New BREAD created through the UI will automatically create a base set of permissions, so manually creating them is often not required.

skydev2020 commented 4 years ago

@flamerecca Thanks for your answer. But when I edit the role/submit. It doesn't update the roles, but it doesn't produce any error on the website/console. I created the new Role with some permission, it correctly create the role with specified permissions. But when I try to update the permission it doesn't. Any idea?

Updating Role with new permissions. https://prnt.sc/r20t2n After update https://prnt.sc/r20teb But after re-open the role https://prnt.sc/r20tpd

fletch3555 commented 4 years ago

I've seen other reports of this, but not sure offhand what the fix was. Take a look around for similar complaints.

Is there anything in the laravel log file?

skydev2020 commented 4 years ago

Nothing in Laravel Log, Ok. I will look around

MrCrayon commented 4 years ago

@skydev2020 here there is the solution for roles not updating permissions #4668

Since I guess your original issue was solved we can close this.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.