File "CreateArticleToProjectRequest.php"

Full Path: /var/www/html/back/app/Domain/CreateArticleToProjectRequest.php
File size: 999 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

declare(strict_types=1);

namespace App\Domain\ArticleToProject\Requests;

use App\BaseClasses\BaseApiRequest;

class CreateArticleToProjectRequest extends BaseApiRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'article_id' => ['required', 'integer', 'exists:articles,id'],
            'project_id' => ['required', 'integer', 'exists:projects,id'],
            'amount_limit' => ['required', 'numeric'],
        ];
    }

    public static function bodyParameters(): array
    {
        return [
            'article_id' => ['description' => 'article_id'],
            'project_id' => ['description' => 'project_id'],
            'amount_limit' => ['description' => 'amount_limit'],
        ];
    }

    public static function example(): array
    {
        return [
            'article_id' => 1,
            'project_id' => 1,
            'amount_limit' => 1000.55,
        ];
    }
}