-
app/Models/License.php
Open in GitHubuse Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Builder; class License extends Model { // public function scopeForProduct(Builder $query, Product $product): void { $query->whereHas('purchasable', fn ( Builder $query ) => $query->where('product_id', $product->id)); } // }