i'm creating admin of my articles, in my resource EDIT post i have some problems, i would like show all tags of my post that i'm editing, i'm tryng like this:
I created a variable array with all tags id relation with the post edited:
$post_tags[0]->tag_id // it return some id of tag's post
Now i would show all tag's post like input checked in my form edit.blade.php
@for ($i = 0; $i < count($all_tags); $i++)
@if($all_tags[$i]->id != $post_tags[$i]->tag_id)
<input style="cursor: pointer;" type="checkbox" name="tags[]" id=" {{$all_tags[$i]->slug}}" value="{{$all_tags[$i]->id}}" data-parsley-mincheck="2" class="flat"/>
@else
<input style="cursor: pointer;" type="checkbox" name="tags[]" id="{{$all_tags[$i]->slug}}" value="{{$all_tags[$i]->id}}" data-parsley-mincheck="2" class="flat" checked/>
@endif
@endfor
But i'm getting this error:
ErrorException in Collection.php line 1187: Undefined offset: 5 (View: C:\xampp\htdocs\sofis\resources\views\admin\post\edit.blade.php)