<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;

class StoreMixed extends FormRequest
{

    /**
     * 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 [
            'file' => $this->hasFile('file') ? 'required|mimes:' . implode(',', config('uploads.allowed_extensions')) . '|max:' . config('uploads.max_size') : '',
            'photo' => $this->hasFile('photo') ? 'mimes:jpeg,bmp,png,svg,gif' : '',
        ];
    }

}
