Search code examples
phplaravelvue.jsvoyager

How I can work with (Laravel voyager) and (Vue SPA)?


Please I want some help about and Issue in My Laravel and Vue SPA Project.

I'm using (Vue SPA) and Laravel Voyager for Admin.

The problem when I want to go to the admin panel using : /admin the panel did not show.

This is my Routes/web.php

<?php

Route::get('/{any}', 'CodeCommunityController@index')->where('any', '^(?!api).*$');
Route::get('/home', 'HomeController@index')->name('home');
Auth::routes();

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

Please help guys and thank you.


Solution

  • I have the same problem, all I did is move the admin route above the any* route.

    Route::group(['prefix' => 'admin'], function () {
        Voyager::routes();
    });
    Route::get('/{any}', 'CodeCommunityController@index')->where('any', '^(?!api).*$');
    Route::get('/home', 'HomeController@index')->name('home');
    Auth::routes();