It works when I upload files around 2MB, but error when I upload 2+MB files I have an application based on Laravel 5 with file upload functionality. 1. I try to insert images(jpeg,bmp,png) and files(Docx,xlsx,pdf) so Everything works fine when the size is arround 2MB but error when I upload 20+MB files Anyone know where the error?
my code
public function rules()
{
return [
'proposition' => 'required',
];
$filename = count($this->input('filename'));
foreach(range(0, $filename) as $index) {
$rules['filename.' . $index] = 'required|mimes:pdf,jpeg,bmp,png,doc,docx,csv,xlsx|max:20000';
}
return $rules;
}
my function
public function store(PropositionRequest $request)
{
$proposition = new Proposition();
$prop = Proposition::create($request->all());
$prop->saveTags($request->get('tags'));
foreach ($request->filename as $filename) {
var_dump($filename);
$filename = $filename->store('filename');
PropositionFiles::create([
'proposition_id' => $prop->num_proposition,
'filename' => $filename
]);
}