Archived
1
0
Fork 0

resources/views/livewire/recipes.blade.php: move recipe link to a component.

This commit is contained in:
Henrik Hautakoski 2021-07-23 13:25:13 +02:00
parent 4628ce85ac
commit 3b71b0358b
2 changed files with 14 additions and 12 deletions

View file

@ -0,0 +1,13 @@
@props(['recipe'])
@php
if ($recipe->spell) {
$id = $recipe->spell->id;
$type = 'spell';
} else {
$id = $recipe->craft->external_id;
$type = 'item';
}
@endphp
<x-wowhead-link :type="$type" :wh-id="$id" href="{{ route('recipe.show', [ 'recipe' => $recipe ]) }}">
{{ $recipe->name }}
</x-wowhead-link>