jeudi 21 janvier 2021

Laravel : ReflectionException Class App\Http\Controllers\DashboardController does not exist

After logging in to my admin dashboard i am getting below error :

ReflectionException Class App\Http\Controllers\DashboardController does not exist

Below is my DashboardController inside : public_html/app/Http/Controllers/Dashboard

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class DashboardController extends Controller
{
    public function index()
    {
        return view('dashboard.index');
    }
}

Routs file :

Auth::routes();
Route::get('logout', function () {
    \Illuminate\Support\Facades\Auth::logout();

    return redirect('/');
});


Route::get('/', 'HomeController@index')->name('home');
//Route::get('/about', 'AboutController@index')->name('about');
Route::get('/events', 'EventController@index')->name('events');
Route::get('/events/{event}', 'EventController@show')->name('events.show');
Route::get('/publications', 'PublicationController@index')->name('publications');
Route::get('/publications/{publication}', 'PublicationController@show')->name('publications.show');

Route::middleware(['web', 'auth'])->group(function () {

    Route::get('search/', 'SearchController@index')->name('search');

});

Route::middleware(['auth', 'dashboard'])->group(function () {
    Route::get('/dashboard', 'DashboardController@index')->name('dashboard.index');
    Route::resource('/dashboard/users/trashed', 'UserTrashedController', ['as' => 'dashboard.users']);
    Route::resource('/dashboard/users', 'UserController', ['as' => 'dashboard']);
    Route::resource('/dashboard/categories/trashed', 'CategoryTrashedController', ['as' => 'dashboard.categories']);
    Route::resource('/dashboard/categories', 'CategoryController', ['as' => 'dashboard']);
    Route::resource('/dashboard/events', 'Dashboard\EventController', ['as' => 'dashboard']);
    Route::resource('/dashboard/activity-logs', 'ActivityLogController', ['as' => 'dashboard']);
    Route::resource('/dashboard/pages', 'Dashboard\PageController', ['as' => 'dashboard']);
    Route::resource('/dashboard/publications', 'Dashboard\PublicationController', ['as' => 'dashboard']);
});

Route::any('/{any}', '\App\Http\Controllers\PageController@show')->where('any', '.*')->name('pages.show');

Below is my laravel version

Laravel Version: 5.8

i have spent hours on this but unable to find the issue , could someone please help me to fix the issue



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire