Hi there stackoverflow!
In my laravel views I am using a default layout by calling
@layout('layouts.default')
to the same controller I am sending Ajax Requests yet I can't put 'if' to @layout if its a ajax call. Because if ajax request has made to controller it also produce header, footer and content(header and footer are in default layout). So to avoid this I made one copy without @layout of my view.
However its so boring to edit two files for making changes. Can't I add a code to my view something like that?:
@if(!$ajaxrequest)
@layout('layouts.master')
@endif
I want this because my codes in controllers are too messy