This commit is contained in:
2022-07-12 13:23:27 +07:00
parent b5f892641d
commit 4e99ba5109
29 changed files with 1826 additions and 228 deletions

View File

@@ -19,4 +19,13 @@ class CorporatePlan extends Model
{
return $this->belongsTo(Corporate::class);
}
public function scopeFilter($query, array $filters)
{
$query->when($filters['search'] ?? false, function ($query, $search) {
return $query
->where('code', 'like', "%" . $search . "%")
->orWhere('name', 'like', "%" . $search . "%");
});
}
}