<?php
/**
 * Created by PhpStorm.
 * User: mrs
 * Date: 07.03.2018
 * Time: 13:56
 */

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreItemRequest extends FormRequest
{
    /**
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * @return array
     */
    public function rules(): array
    {
        return [
            'caption' => 'required|string|max:70',
            'user_id' => 'required|exists:users,id',
            'category_id' => 'required|exists:categories,id',
            'subcategory_id' => 'required|exists:subcategories,id',
            'description' => 'string|max:2048 '
        ];
    }

}