Im having this fatal error exception that i cant seem to figure out:
Class 'App\Http\Controllers\Admin\Controller' not found
For some reason im not sure why it is tacking controller at the end of that error. My namespace for the controller:
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Announcement;
use App\Http\Requests;
class AnnouncementController extends Controller
{
...
}
and my routes:
Route::group(['prefix' => 'admin','namespace'=>'Admin', 'middleware'=>'auth'], function () {
Route::resource('announcements','AnnouncementController');
});
But when i navigate to the /admin/announcements route i get that fatal exception with the Controller tacked on at the end..
This controller is in the App\Http\Controllers\Admin directory so i m not sure why i m getting this error. Am i name spacing wrong?
App\Http\Controllers\Admin'namespace'=>'Admin'and add theuse App\Http\Controllers\Controller;'namespace' => 'Admin'then just refer to the controller in the route asAnnouncementController. Laravel assumesApp\Http\Controllersnamespace is what you are starting with, based on your RouteServiceProvider.