There are probably different ways to achieve this.
In my opinion it's better to keep the make
method non-dynamic and to share the layout setup across all the views with View:share
.
After what you may need to do an if statement to specify how your layouts have to be used.
$layout_name = 'full_width'; // should be the result of the db query
View:share('layout', $layout_name); // use it in your controllers, wherever you want
And in the concerned views:
@if ($layout == 'full_width')
@extends('layout.fullwidth')
@elseif ($layout == 'sidebar')
@extends('layout.sidebar')
@endif
This solution assumes that you know the different types of layouts that can be used.