How to change laravel views location in runtime
Aug 1, 2023
For instance, if you want to create a new folder structure and separate your module as follows:
app/module/feature1
feature1/
controller
Feature1Controller
resources
feature1.blade.php
So, if you want to load the view file from Feature1Controller, you should write the code as follows:
class Feature1Controller”
class ManualActionLogController extends Controller
{
public function showForm()
{
View::addLocation(__DIR__."/../Resource/");
return view("feature1");
}
}