2021-05-15 19:29:56 -04:00
|
|
|
@php
|
|
|
|
$isFavourite = $entity->isFavourite();
|
|
|
|
@endphp
|
|
|
|
<form action="{{ url('/favourites/' . ($isFavourite ? 'remove' : 'add')) }}" method="POST">
|
|
|
|
{{ csrf_field() }}
|
2023-09-10 10:18:31 -04:00
|
|
|
<input type="hidden" name="type" value="{{ $entity->getMorphClass() }}">
|
2021-05-15 19:29:56 -04:00
|
|
|
<input type="hidden" name="id" value="{{ $entity->id }}">
|
2023-01-28 11:06:11 -05:00
|
|
|
<button type="submit" data-shortcut="favourite" class="icon-list-item text-link">
|
2021-05-15 19:29:56 -04:00
|
|
|
<span>@icon($isFavourite ? 'star' : 'star-outline')</span>
|
|
|
|
<span>{{ $isFavourite ? trans('common.unfavourite') : trans('common.favourite') }}</span>
|
|
|
|
</button>
|
|
|
|
</form>
|