app/Http/Livewire/Recipes.php: eager-load crafters relationship.
This commit is contained in:
parent
43a26681d9
commit
645eaf676c
1 changed files with 1 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ class Recipes extends Component
|
|||
public function render()
|
||||
{
|
||||
$query = Recipe::select('recipes.*')
|
||||
->with(['crafters'])
|
||||
->leftJoin('items', 'items.id', '=', 'recipes.item_id')
|
||||
->leftJoin('spells', 'spells.id', '=', 'recipes.spell_id')
|
||||
->orderBy(DB::raw('(IF(`recipes`.`spell_id` IS NOT NULL, `spells`.`name`, `items`.`name`))'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue