i want to move multiple file using laravel, here what i try
foreach ($request->file as $allfiles){
$songname = time().'.'.$allfiles->getClientOriginalExtension();
$allfiles->move(public_path('samplesong'), $songname);
$input['id_single'] = $single->id;
$input['title_song'] = 'Title Song';
$input['file_sample_song'] = $songname;
$artist = RelationSingleSampleSong::create($input);
}
code above just move 2 files from 4 files that i choose.
in database all files inserted successfully.
from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2Aa25SU
via IFTTT
Aucun commentaire:
Enregistrer un commentaire