PHP code example of alighale / laravel-file-manager
1. Go to this page and download the library: Download alighale/laravel-file-manager 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/ */
alighale / laravel-file-manager 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 = \AliGhale\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 = \AliGhale\FileManager\Facades\File::type("type_name") // type name in config file (filemanager.php)
->upload($file);
php
'providers' => [
// for laravel 5.8 and below
\AliGhale\FileManager\FileManagerServiceProvider::class,
];