M
M
mrFlyer2017-03-07 23:22:30
Laravel
mrFlyer, 2017-03-07 23:22:30

How to change folder with view not through config file?

Tell me how to change the folder with views on Laravel without touching the configuration file itself?
I tried these two options, but the views are still taken from the folder that is specified in the config file.
config(["view.paths"=>$newPaths]);

app()->bind('view.finder', function ($app) {
   // $newPaths = .... ;
   return new \Illuminate\View\FileViewFinder($app['files'], $newPaths);
});

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mrFlyer, 2017-03-08
@mrFlyer

Found this solution:
Adds a new one to an existing config path. The template is searched first in this folder, if it is not found there, then it looks at the folder specified in the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question