. */ declare(strict_types=1); namespace FireflyIII\Api\V1\Requests; /** * * Class JournalLinkRequest */ class JournalLinkRequest extends Request { /** * @return bool */ public function authorize(): bool { // Only allow authenticated users return auth()->check(); } /** * @return array */ public function getAll(): array { return [ 'link_type_id' => $this->integer('link_type_id'), 'inward_id' => $this->integer('inward_id'), 'outward_id' => $this->integer('outward_id'), 'notes' => $this->string('notes'), ]; } /** * @return array */ public function rules(): array { return [ 'link_type_id' => 'required|exists:link_types,id', 'inward_id' => 'required|belongsToUser:transaction_journals,id', 'outward_id' => 'required|belongsToUser:transaction_journals,id', 'notes' => 'between:0,65000', ]; } }