Reputation: 590
I want to @include('item_1')
, if not the item_1
view then @include('default')
.
Idk how to include default
view.
My laravel version is 5.2.
Upvotes: 1
Views: 113
Reputation: 163778
You can try exists()
method:
@include(View::exists('item_1') ? 'item_1' : 'default')
Upvotes: 1
Reputation: 2166
@if (View::exists('item_1'))
@include('item_1')
@else
@include('default')
Just use a if statement
Upvotes: 0