In Laravel 5.7 a convenient way to place all the template files in a separate subfolder views?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
80 views
Hello.

The bottom line is this:
I want to do a design project in a separate "themes" (like in WordPress), so as not to overwrite an already created through, for example, the make:auth, etc. templates, but just in a separate folder to make a new one.

But to register for each view function new path (in the controller or router) is pain. Want to make a more centralized and easy to change it and so this change did not cause then the new problems, in General, in mind. And I don't know how to do it.

I in an adjacent topic I suggest:
do your implementation of Newcomputer over the existing that she is automatically included in the path of your desired theme

and
anything Google is not necessary, because it is unlikely that you will find. But you can try: "laravel ViewComposer override" or similar. The usual PLO + laravel ioc.
but I am Laravel beginner and for me it sounds sort of like "Avada Kedavra".

Please poke the finger, and where necessary prescribe that Laravel has taken the view function for

Auth::routes(['verify' => true]);
not
resources/views/auth
but, say, in
resources/views/mytheme/auth
or something like that.

Thank you very much.
by | 80 views

2 Answers

0 like 0 dislike
The most primitive method is just to substitute the prefix
Controller
private $viewPath = 'site'; //just substitute return view($this->viewPath . '/ index');

And so each controller your way, but of course look still is not the best option
UPDATED
Go to config/view.php
'paths' => [ resource_path('views') . 'on my way', ],

and afterwards
php artisan config:cache
php artisan cache:clear
and all
by
0 like 0 dislike
First, I must say that larabel projects is required very rarely, it's not a cms, if a serious redesign, in any case, rather to the old you will not return. If he uses git, you can always revert to the old design. But again, changing the design and most likely some functionality will change, too, and this functionality will not be compatible with the old theme.

Secondly.. if you still need to do it (the only option when you really need to see something like this: day one the theme of the night is different. Something like this), just in the config file, make the corresponding key in the base controller from which inherit all the others make the method view, which already define the full path to the view function with the theme. Or doing an trait, in which again a method create. That's all
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
36,634 users