Skip to main content

spatie/spatie.be

495 stars
1 code files
View spatie/spatie.be on GitHub

app/Models/License.php

Open in GitHub
use 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));
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.