Voyager: Route [voyager.dashboard] not defined.

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

  • Laravel Version: 5.3
  • Voyager Version: the latest
  • PHP Version: 7

Most helpful comment

I think we should reload the routes/web.php file when the routes have been published.

All 19 comments

Did you run the php artisan voyager:install command?

yes i did

What does your routes/web.php file looks like?

it was solved , thank you

Hi there,

Same issue here with Laravel 5.4 doing a new site installation + voyager installation following the readme instructions. Steps to reproduce:

laravel new sitename
composer require tcg/voyager
php artisan voyager:install --with-dummy

Last command generates the error below

...
Migrated: 2017_01_15_000000_make_table_name_nullable_in_permissions_table
Dumping the autoloaded files and reloading all new files
Adding Voyager routes to routes/web.php
Seeding data into the database

  [InvalidArgumentException]              
  Route [voyager.dashboard] not defined.  

The routes/web.php has the following routes:

Route::get('/', function () {
    return view('welcome');
});


Route::group(['prefix' => 'admin'], function () {
    Voyager::routes();
});

Admin page is accessible, but I cannot login because the users table has no dummy data

Edit: I relaunched php artisan voyager:install --with-dummy and it now managed to seed the db with the dummy data.

So your issue was only happening the first time it tried to run the installation?

Yes, I re-run the installation command and it managed to seed the db, without modifying anything in between both runs

@marktopper I think the issue is that Voyager during installation adds the routes to /routes/web.php, but when MenuItemsTableSeeder tries to access the route, it's still not loaded until the next time Laravel boots up.

I think we should reload the routes/web.php file when the routes have been published.

I had this same issue, but it was an existing installation and I was seeding a custom Data type. I get the error on the first run but not on the second run.

@marktopper
add pls \Route::group(['prefix' => 'admin'], function () {\Voyager::routes();}); to line 82 InstallCommand.php to solve problem.
because route voyager must be load.
thnx

@etconsilium: Mind sending a pull request?

Thanks @etconsilium

I get the following error when run my laravel project.

(3/3) ErrorException
Route [custom.profiles] not defined. (View: C:xampphtdocsPaxGmsresourcesviewslayoutsapp.blade.php) (View: C:xampphtdocsPaxGmsresourcesviewslayoutsapp.blade.php)

these are my routes

Route::get('/', function () {
return view('welcome');
});
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

Route::get('admin/home', 'AdminController@index')->name('admin.home');

Route::get('admin', 'AdminLoginController@showLoginForm')->name('admin.login');
Route::post('admin', 'AdminLoginController@login');
Route::post('admin-password/email', 'AdminForgotPasswordController@sendResetLinkEmail')->name('admin.password.email');
Route::get('admin-password/reset', 'AdminForgotPasswordController@showLinkRequestForm')->name('admin.password.request');
Route::post('admin-password/reset', 'AdminResetPasswordController@reset');
Route::get('admin-password/reset/{token}', 'AdminResetPasswordController@showResetForm')->name('admin.password.reset');
Route::get('custom/profiles', 'UserController@index');

this is UserController

namespace AppHttpControllers;

//use IlluminateHttpRequest;
use Auth;
class UserController extends Controller
{
public function profile()
{
return view('custom.profiles', array('user' => Auth::user()));
}
}

html


Profile

Please any help?
Thanks in advance!

@tranpuil, this issues has had no activity for 3 months. In the future, please post on slack or create your own issue.

Your issue is unrelated to Voyager, please try asking for help in a more generic laravel forum, such as on laracasts.com or in the larachat slack group.

Hello, Somebody can help me about GIT? How to use this admin Voyager using git? For example, If you need add new content type, how to add to git for future push and deploy in the remote server?

Route [voyager.dashboard] not defined

I am having this issue on a website which was just working for 5 months and all of a sudden I'm facing this please help

This issue has been closed for nearly 2 years now. Please open your own issue instead of commenting on old issues.

Also, there's zero chance that this suddenly broke. Something absolutely did change, though maybe not consciously by you. Please make sure to include ANY changes that might be related.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wp-src picture wp-src  路  3Comments

craigb88 picture craigb88  路  3Comments

vaggelis2018 picture vaggelis2018  路  3Comments

MikadoInfo picture MikadoInfo  路  3Comments

wislem picture wislem  路  3Comments