mehrdad70
5 سال پیش توسط mehrdad70 مطرح شد
0 پاسخ

رفع ارور Route not defined. لاراول

دوستان روت هامو کامنت کردم دستور php artisan optimize:clear رو زدم بعد که روت هامو از کامنت در اوردم خطا
Route [users.index] not defined.
رو بهم میده هر روتی هم کامنت میکنم ارور روت بعدیشو میده اینم روت هام
@hesammousavi

Route::namespace('Admin')->middleware(['web' , 'auth'])->group(function(){
    Route::get('dashboard' , 'DashboardController@index')->name('dashboard.index');
    Route::get('profile' , 'UserController@profile')->name('users.profile');
    Route::resource('users', 'UserController');
    Route::resource('categories', 'CategoryController');
    Route::resource('products', 'ProductController');
    Route::resource('roles', 'RoleController');
    Route::resource('permissions', 'PermissionController');
    Route::resource('articles', 'ArticleController');
    Route::resource('brands', 'BrandController');
    Route::resource('attributeGroups', 'AttributeGroupController');
    Route::resource('attributes', 'AttributeController');
    Route::resource('attributeItems', 'AttributeItemController');
    Route::resource('coupons', 'CouponController');
    Route::post('attributes/{GroupId}' , 'AttributeController@store')->name('attributes.store');
    Route::post('attributeItems/{AttributeId}' , 'AttributeItemController@store')->name('attributeItems.store');
    Route::get('category/{category}' , 'CategoryController@categoryAttribute')->name('category.attribute');
    Route::post('category/{category}' , 'CategoryController@storeAttribute')->name('category.storeAttribute');
});
class DashboardServicePovider extends ServiceProvider
{
    public function register()
    {

        config()->set('sidebar.items.dashboard' , [
            "name" => "پیش خوان",
            "icon" => "fa-store-alt",
            "url" => url('dashboard'),
        ]);

        config()->set('sidebar.items.users' , [
            "name" => "کاربران",
            "icon" => "fa-users",
            "url" => route('users.index'),
        ]);  

        config()->set('sidebar.items.categories' , [
            "name" => "دسته بندی ها",
            "icon" => "fa-database",
            "url" => route('categories.index'),
        ]) ;  
        config()->set('sidebar.items.products' , [
            "name" => "محصولات",
            "icon" => "fa-bullhorn",
            "url" => route('products.index'),
        ]) ;  
        config()->set('sidebar.items.roles' , [
            "name" => "سطح دسترسی کاربر",
            "icon" => "fa-user-shield",
            "url" => route('roles.index'),
        ]) ;  
        config()->set('sidebar.items.articles' , [
            "name" => "مقالات",
            "icon" => "fa-file-signature",
            "url" => route('articles.index'),
        ]) ;  
        config()->set('sidebar.items.brands' , [
            "name" => "برند ها",
            "icon" => "fa-certificate",
            "url" => route('brands.index'),
        ]) ;  
        config()->set('sidebar.items.attributes' , [
            "name" => "ویژگی های محصول",
            "icon" => "fa-receipt",
            "url" => route('attributeGroups.index'),
        ]) ;  

        config()->set('sidebar.items.coupons' , [
            "name" => "کد تخفیف",
            "icon" => "fa-gift",
            "url" => route('coupons.index'),
        ]) ;  
    }

    public function boot()
    {
    }
}