thedevdojo / voyager

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

when i go /admin, redirected to / #1543

Closed trollsk1n closed 7 years ago

trollsk1n commented 7 years ago

Description:

i install clear laravel & voyager, register user with php artisan voyager:admin admin@ekopen.uz set admin name and password, then create laravel auth with php artisan make:auth after i go to /admin/login, write my login and password, but after browser sends to url '/', if i go to '/home', i see message 'You are logged in!' '/admin' not worked, but in routes/web.php i see Route::group(['prefix' => 'admin'], function () { Voyager::routes(); });

Steps To Reproduce:

Ahmed-Aboud commented 7 years ago

php artisan voyager:admin your@email.com --create

trollsk1n commented 7 years ago

i have a admin user in database, I can't get to the admin panel, just go straight to the main page

emptynick commented 7 years ago

Check issue #1217 and #1164 as it seems to be the same.

fletch3555 commented 7 years ago

@trollsk1n, if you have direct access to your DB, please confirm that your user is in the "admin" role (likely id = 1). Also, please confirm that that role has the browse_admin permission set.

trollsk1n commented 7 years ago

I entered the command php artisan voyager:admin [myadmin] and get the answer The user now has full access to your site.. In database in table users i have the only user with role_id=1 and in the table roles the only record with id=1 and name=admin, other tables likely permissions, permissions_group, permission_role is empty

trollsk1n commented 7 years ago

I found a solution, if u use MariaDB or old version of MySQL go to the app\Providers\AppServiceProvider.php and add to boot function string Schema::defaultStringLength(191); after enter the command php artisan voyager:install.

fletch3555 commented 7 years ago

Yes that's certainly required per the laravel 5.4 docs due to an issue with the collation type used and a change in newer MySQL versions.

Rerunning artisan voyager:install is what fixed the symptoms you were describing. It ran the permissions seeder, which added the "browse_admin" permission and then added it to the admin role, which gave you access.

github-actions[bot] commented 4 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.