mardi 7 juillet 2020

404 not found error only in one route Laravel 7

I am refactoring my code and getting 404 Page not found error in one route. I tried every possible solution but no luck. My route is give below:

Route::prefix('admin')->group(function () {
    .... other routes
    
    Route::prefix('product')->group(function () {
        .... other routes

        Route::prefix('category')->group(function () {
            Route::get('/', function () {
                dd('check');
            });

            <!-- Route::get('/', 'ProductCategoryController@index')->name('product_category_index'); -->
           
            .... other routes

        });
    });
});

In debugbar I am getting the exception:

No query results for model [App\Product] category F:\bvend\bvend.web\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Builder.php#389 Illuminate\Database\Eloquent\ModelNotFoundException

I have no longer App\Category model in my code. Instead I have App\ProductCategory

I have no clue what the mistake is. Please help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire