Answers for "Laravel return empty relationship on model when condition is true"

0

Laravel return empty relationship on model when condition is true

public function shop(): BelongsTo
{
    if(true) {
        return new BelongsTo($this->newQuery(), $this, '', '', '');
    }
    return $this->belongsTo('App\Models\Shop');
}
Posted by: Guest on June-08-2021

Code answers related to "Laravel return empty relationship on model when condition is true"

Browse Popular Code Answers by Language