Conditional extends in Blade
This kind of logic should really be kept out of the template.
In your controller set the $layout
property to be dashboard.master then instead of calling returning your view or response, terminate with just $this->layout->content = View::make('dashboard.template')
Take a look at the Laravel docs on this
You could end up with something like this
<?phpclass Something extends BaseController { $layout = 'dashboard.master'; public function getIndex() { $template = View::make('dashboard.template'); if(Request::ajax()) { return $template; } $this->layout->content = $template; }}