1. Go to this page and download the library: Download mhshagor/file-picker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mhshagor / file-picker example snippets
public function store(Request $request)
{
$request->validate([
'avatar' => '$request->hasFile('avatar')) {
$file = $request->file('avatar');
$path = $file->store('avatars', 'public');
// Save path to database
}
if ($request->hasFile('gallery_images')) {
foreach ($request->file('gallery_images') as $file) {
$path = $file->store('gallery', 'public');
// Save path to database
}
}
}