Hello i have two folders in resources folder in laravel one is front end and other is back end which is admin folder.But accessing views from admin folder generates error when accessing view via controller View [login] not found. here is my folder structure for admin panel. Resources -> admin -> views -> login.blade.php for front end Resources -> views->welcome.blade.php
on Logincontroller
class Logincontroller extends Controller
{
public function index()
{
return view('login');
}
}
i have tried also return view('admin/login');
but web route works perfectly
Route::get('admin/login', function () {
return view('login');
});
and below Route generates error Route::get('/login', 'Logincontroller@index');
resources/viewsdirectory ... if you want to have them some where else you would have to configure the application to know thatlogininresources/viewsthat is why ... it only looks for views inresources/views... if it isn't in there somewhere then it doesn't existloginunderresources/viewsor you somehow changed the root of your views. You should move your admin views inresources/views/adminand then you can access them via e.g.view('admin.login')