João Serra
João Serra

Reputation: 253

Multiple Views/Assets Folders in Laravel

So my question regards Laravel 5.2 and is as follows.

I have a project where for the purposes of fast AB Testing i need to duplicate views and any assets that go along with those views.

Meaning that the goal is so that inside of my resources folder i have a structure like

Is this something that's possible in Laravel? What implications would this have?

Upvotes: 1

Views: 1980

Answers (1)

Tim Sheehan
Tim Sheehan

Reputation: 4014

If you take a look at config/view.php:

https://github.com/laravel/laravel/blob/5.2/config/view.php

You can add in new paths for Laravel to load views from like so:

'paths' => [
    realpath(base_path('resources/views')), // default
    realpath(base_path('a/views')),
    realpath(base_path('b/views')), 
],

If you use the same structure/naming conventions you should be able to simply swap the paths in and out from a to b for quick testing.

Upvotes: 2

Related Questions