%PDF- %PDF-
Mini Shell

Mini Shell

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

<?php

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

use App\Http\Requests\BaseRequest;
use App\Models\Post;

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',
            'content'        => 'required|string',
            'featured_image' => 'required|string',
            'video_type'     => 'nullable|string|in:' . Post::getAvailableValidationVideoTypes(),
            'video_url'      => 'nullable|required_with:video_type',
            'categoriesId'   => 'required|array',
            'country_id'     => 'required|integer|exists:countries,id',
        ];
    }
}

Zerion Mini Shell 1.0