mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Filtering by is_custom
This commit is contained in:
parent
3adb74cc22
commit
50cb855579
@ -64,4 +64,18 @@ class DesignFilters extends QueryFilters
|
||||
{
|
||||
return $this->builder->where('company_id', auth()->user()->company()->id)->orWhere('company_id', null)->orderBy('id', 'asc');
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the designs by `is_custom` column.
|
||||
*
|
||||
* @return Illuminate\Database\Query\Builder
|
||||
*/
|
||||
public function custom(string $custom): Builder
|
||||
{
|
||||
if (strlen($custom) === 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
return $this->builder->where('is_custom', filter_var($custom, FILTER_VALIDATE_BOOLEAN));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user