skip to Main Content

Laravel local scope with hasMany relation

I have a Laravel model Product and Vouchers defined as follows: class Product extends Model { public function vouchers(): HasMany { return $this->hasMany(Voucher::class); } } and class Voucher extends Model { public function product(): BelongsTo { return $this->belongsTo(Product::class); } }…

VIEW QUESTION
Back To Top
Search