Voyager: when i go /admin, redirected to /

Created on 8 Aug 2017  路  8Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4
  • Voyager Version: 0.11.14
  • PHP Version: 7.1.1
  • Database Driver & Version: mysql

Description:

i install clear laravel & voyager, register user with php artisan voyager:admin [email protected] 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:

Most helpful comment

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.

All 8 comments

php artisan voyager:admin [email protected] --create

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

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

@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.

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

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.

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wislem picture wislem  路  3Comments

iwasherefirst2 picture iwasherefirst2  路  3Comments

TXRRNT picture TXRRNT  路  3Comments

Nagendra1421 picture Nagendra1421  路  3Comments

abacram picture abacram  路  3Comments