app/Http/Requests/UploadRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        $rules = [
            'filename' => 'required'
        ];
        $files = count($this->input('files'));
        foreach(range(0, $files) as $index) {
            $rules['files.' . $index] = 'image|mimes:jpeg,png|max:1000';
        }
        return $rules;
    }
public function rules ( ) { $ rules = [ 'filename' => 'required' ] ; $ files = count ( $ this -> input ( 'files' ) ) ; foreach ( range ( 0 , $ files ) as $ index ) { $ rules [ 'files.' . $ index ] = 'image|mimes:jpeg,png|max:1000' ; } return $ rules ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .