1
0
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:
Benjamin Beganović 2023-04-13 17:17:08 +02:00
parent 3adb74cc22
commit 50cb855579

View File

@ -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));
}
}