Auto commit for release 'v6.1.16' on 2024-05-19

This commit is contained in:
github-actions
2024-05-19 10:26:25 +02:00
parent 0acd54c2b7
commit 90109917df
50 changed files with 264 additions and 254 deletions

View File

@@ -30,22 +30,23 @@ use LaravelJsonApi\Core\Query\QueryParameters;
trait ParsesQueryFilters
{
private function dateOrToday(QueryParameters $parameters, string $field): Carbon
{
$date = today();
try {
$date = Carbon::createFromFormat('Y-m-d', $parameters->filter()?->value($field, date('Y-m-d')), config('app.timezone'));
} catch (InvalidFormatException $e) {
Log::debug(sprintf('Invalid date format in request. Using today: %s', $e->getMessage()));
}
return $date;
return $date;
}
private function arrayOfStrings(QueryParameters $parameters, string $field): array
{
$array = $parameters->filter()?->value($field, []) ?? [];
return is_string($array) ? [$array] : $array;
}
@@ -53,5 +54,4 @@ trait ParsesQueryFilters
{
return (int) ($parameters->page()[$field] ?? $default);
}
}

View File

@@ -40,7 +40,6 @@ trait ValidatesUserGroupTrait
/**
* An "undocumented" filter
*
*
* TODO add this filter to the API docs.
*
* @throws AuthorizationException
@@ -55,11 +54,6 @@ trait ValidatesUserGroupTrait
throw new AuthenticationException();
}
/** @var User $user */
$user = auth()->user();
$groupId = 0;