1. Go to this page and download the library: Download twom/laravel-file-manger 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/ */
twom / laravel-file-manger example snippets
$file = request()->file('filename');
$upload = File::upload($file);
// get file uploaded path
$filePath = $upload->getFilePath();
// get file name
$fileName = $upload->getName();
$file = request()->file('filename');
$upload = \Twom\FileManager\Facades\File::setName('your specific name')
->isPrivate()
->setFormat('png')
->dateTimePrefix()
->upload($file);
// get file uploaded path => if is public you can use it for download
dd($upload->getFilePath());
$file = request()->file('filename');
$upload = \Twom\FileManager\Facades\File::type("type_name") // type name in config file (filemanager.php)
->upload($file);
php
'providers' => [
// for laravel 5.8 and below
\Twom\FileManager\FileManagerServiceProvider::class,
];