It works now like this:
$files = $request->file('attachment');
if($request->hasFile('attachment'))
{
foreach ($files as $file) {
$file->store('users/' . $this->user->id . '/messages');
}
}
I had to append []
after the value of the name
attribute, so:
<input type="file" name="attachment[]" multiple>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…