I want to display only items that are created by the logged in user. Why this not working?
View
<select name="team_id" class="form-control section">
<option value="0"></option>
@foreach (App\Team::all() as $team)
@can('hiddenAction', $team)
<option value=""></option>
@endcan
@endforeach
</select>
Police
public function hiddenAction(User $user, Team $team)
{
return $team->author_id === $user->id;
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire