. */ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests; /** * Class AccountObjectGroupUpdateRequestUpdateRequest * * @codeCoverageIgnore */ class ObjectGroupUpdateRequest extends Request { /** * Authorize logged in users. * * @return bool */ public function authorize(): bool { // Only allow authenticated users return auth()->check(); } /** * @return array */ public function getUpdateData(): array { return [ 'title' => $this->string('title'), 'order' => $this->integer('order'), ]; } /** * The rules that the incoming request must be matched against. * * @return array */ public function rules(): array { $objectGroup = $this->route()->parameter('objectGroup'); return [ 'title' => sprintf('min:1|uniqueObjectGroup:%d', $objectGroup->id), 'order' => 'numeric', ]; } }