My controllers which are HomeController and BlogController in Admin folder. My views like:
- /admin
- index.blade.php
- /blog
- index.blade.php
I want to call /admin0admin url to /resources/views/admin/index.blade.php.
I want to call /admin0admin/blog url to /resources/views/admin/blog/index.blade.php
Here how i call in view:
<a href="{{ route('admin0admin.blog') }}" class="br-menu-link">
And my routes like:
Route::group(['namespace' => 'Admin', 'prefix' => 'admin0admin'], function () {
Route::get('/', 'HomeController@index')->name('index');
Route::group(['prefix' => 'blog'], function () {
Route::get('/', 'BlogController@index')->name('index');
});
});
And my BlogController index method:
return view('admin.blog.index');
I got an 404 not found error.
Route [admin0admin.blog] not defined
Laravel Version is : 5.6.*
php artisan route:list
to find out what the names and routes are in your app. - Jeffadmin0admin.blog
, notindex
.prefix
does not affect names of routes, so you need to write it out. - Jeff