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();
});
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.
Most helpful comment
I found a solution, if u use
MariaDBor old version ofMySQLgo to theapp\Providers\AppServiceProvider.phpand add tobootfunction stringSchema::defaultStringLength(191);after enter the commandphp artisan voyager:install.