weiman99
1 month ago
132
3
Laravel

Laravel redirect problem

Posted 1 month ago by weiman99

Hey guys, can help me to solve this please?

Symfony\Component\Routing\Exception\RouteNotFoundException
Route [admin.customers] not defined.

This is my route

<?php

Route::redirect('/', '/login');
Route::get('/home', function () {
    if (session('status')) {
        return redirect()->route('admin.home')->with('status', session('status'));
    }

    return redirect()->route('admin.customers');
});

Auth::routes();
// Admin

Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth']], function () {
    Route::get('/', '[email protected]')->name('home');
    Route::get('user-alerts/read', '[email protected]');
    // Permissions
    Route::delete('permissions/destroy', '[email protected]')->name('permissions.massDestroy');
    Route::resource('permissions', 'PermissionsController');

    // Roles
    Route::delete('roles/destroy', '[email protected]')->name('roles.massDestroy');
    Route::resource('roles', 'RolesController');

    // Users
    Route::delete('users/destroy', '[email protected]')->name('users.massDestroy');
    Route::resource('users', 'UsersController');

    // Audit Logs
    Route::resource('audit-logs', 'AuditLogsController', ['except' => ['create', 'store', 'edit', 'update', 'destroy']]);

Please sign in or create an account to participate in this conversation.