I'm trying to make a website that has 2 or more layouts, any user can change his/her layout.
I know we can use layouts in controllers like this
public $layout = 'layouts.default';
...
and in method
$this->layout->nest('content', $view, $data );
but this is useless for me, it's always default, I mean how can change the value of $layout dynamicly?
for example user views website as default layout but user b views it as black layout.
------------ EDITED
I store layouts in user table, but the problem is how can I add a conditional statement in controller? the $laravel variable which stores the layout name is a property and can be set only once in the code, can not add statement outside any methods to change it.