> */ public function rules(): array { return [ // Filter by user ID 'user_id' => [ 'string', 'uuid', new ExistsEloquent(User::class, null, function (Builder $builder): Builder { /** @var Builder $builder */ return $builder->belongsToOrganization($this->organization); }), ], // Filter only time entries that have a start date before (not including) the given date (example: 2021-12-31) 'before' => [ 'nullable', 'string', 'date_format:Y-m-d\TH:i:s\Z', 'before:after', ], // Filter only time entries that have a start date after (not including) the given date (example: 2021-12-31) 'after' => [ 'nullable', 'string', 'date_format:Y-m-d\TH:i:s\Z', ], // Filter only time entries that are active (have no end date, are still running) 'active' => [ 'string', 'in:true,false', ], // Limit the number of returned time entries (default: 150) 'limit' => [ 'integer', 'min:1', 'max:500', ], // Filter makes sure that only time entries of a whole date are returned 'only_full_dates' => [ 'string', 'in:true,false', ], ]; } }