Dinesh Uprety
@dineshuprety ·
Public
Keep OR branches grouped
PHPOriginal CodeSnap example inspired by Laravel News. Source: https://laravel-news.com/eloquent-tips-tricks
PHP
CodeSnap // free canvas
Keep OR branches grouped
<?php
$matches = Record::query()
->where('tenant_id', $tenantId)
->where(fn ($q) => $q
->where('status', 'ready')
->orWhere('priority', 'high'))
->get();
// Further reading: https://laravel-news.com/eloquent-tips-tricks