Answer the question
In order to leave comments, you need to log in
How to make additional communication in Laravel?
The model has two functions
public function variant(){
return $this->belongsTo('App\Variant')->whereHas('product', function ($query) {
$query->where('visible', 1);
});
}
public function varianto(){
return $this->belongsTo('App\Variant')->whereHas('product', function ($query) {
$query->where('visible', 1);
});
}
@foreach($order->items as $item)
@if($i++)
<hr>
@endif
{{ $item->variant }}1
{{ $item->varianto }}2
@endforeach
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question