Comparison of lines in Laravel 5 blades
I have this in my click file:
<select class="form-control" name="category" id="category">
@foreach ($category as $h)
@if ({{$h->id}} == {{$directory->category}})
<option value="{{$h->id}}" selected>{{$h->name}}</option>
@else
<option value="{{$h->id}}">{{$h->name}}</option>
@endif
@endforeach
</select>
and controller:
$directory= Directory::find($id);
$category = StoreCategory::all();
return view('edit')->with('category', $category)->with('directory', $directory);
After opening the edit, I get a "syntax error, unexpected" <'"
I tried to remove the if-else condition and it works fine.