Fixed empty search scenario

This commit is contained in:
Dan Brown 2020-06-27 13:37:18 +01:00
parent 715dee2d0e
commit 7a2e39212e
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -45,6 +45,10 @@ class SearchOptions
*/
public static function fromRequest(Request $request): SearchOptions
{
if (!$request->has('search') && !$request->has('term')) {
return static::fromString('');
}
if ($request->has('term')) {
return static::fromString($request->get('term'));
}