PHP [SOLVED]: Laravel: view and controller in same directory Home › Forums › Scripting › PHP Tutorials › PHP [SOLVED]: Laravel: view and controller in same directory Tagged: laravel, php Viewing 2 posts - 1 through 2 (of 2 total) Author Posts January 1, 2018 at 3:54 am #245546 Cloudy PointKeymaster Question Is it possible to have views and controllers under the same directory in Laravel? I am looking to achieve something like this: . ??? app | ??? Index | ??? Controller.php | ??? index.blade.php | ??? SomeService.php | ??? SomeRepository.php January 1, 2018 at 3:55 am #245547 Cloudy PointKeymaster Answer You can use addNamespace() to add a new namespace and use your views as you would use views from some package: view()->addNamespace('index', base_path('app/Index')); return view('index::blade.view'); Source: https://stackoverflow.com/questions/48028355/laravel-view-and-controller-in-same-directoryAuthor: Alexey MezeninThis work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Author Posts Viewing 2 posts - 1 through 2 (of 2 total) You must be logged in to reply to this topic.