Answer the question
In order to leave comments, you need to log in
Route [admin.users.index] not defined. (View: /var/www/resources/views/layouts/partials/tabs.blade.php)?
Created a UserController controller of type resource.
Route::group([
'prefix' => 'admin',
'as' => 'admin.',
'middleware' => 'auth'
], function () {
Route::get('/', [\App\Http\Controllers\Admin\HomeController::class, 'index'])->name('index');
Route::resource('users', '\App\Http\Controllers\Admin\UserController');
});
<a href="{{ route('admin.users.edit', $user) }}" class="btn btn-success mr-3">Edit</a>
Answer the question
In order to leave comments, you need to log in
Understood, the problem was in breadcrumbs.
It was necessary to pass the $user parameter, hence the app.blade.php template in the header.
// Home
Breadcrumbs::for('home', function (BreadcrumbTrail $trail) {
$trail->push('Home', route('home'));
});
Breadcrumbs::for('login', function (BreadcrumbTrail $trail) {
$trail->parent('home');
$trail->push('Login', route('login'));
});
Breadcrumbs::for('register', function (BreadcrumbTrail $trail) {
$trail->parent('home');
$trail->push('Register', route('register'));
});
// Home > Blog
Breadcrumbs::for('contact', function (BreadcrumbTrail $trail) {
$trail->parent('home');
$trail->push('Contacts', route('contact'));
});
Breadcrumbs::for('admin.index', function ($trail) {
$trail->push('Admin', route('admin.index'));
});
Breadcrumbs::for('admin.users.index', function (BreadcrumbTrail $trail) {
$trail->parent('admin.index');
$trail->push('Users', route('admin.users.index'));
});
Breadcrumbs::for('admin.users.create', function (BreadcrumbTrail $trail) {
$trail->parent('admin.users.index');
$trail->push('Create', route('admin.users.create'));
});
Breadcrumbs::for('admin.users.show', function (BreadcrumbTrail $trail, User $user) {
$trail->parent('admin.users.index');
$trail->push($user->name, route('admin.users.show', $user));
});
Breadcrumbs::for('admin.users.edit', function ($trail, User $user) {
$trail->push('Edit', route('admin.users.edit', $user));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question