PHP code example of miladimos / laravel-filemanager
1. Go to this page and download the library: Download miladimos/laravel-filemanager 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/ */
miladimos / laravel-filemanager example snippets
// in providers
Miladimos\FileManager\Providers\FileManagerServiceProvider::class,
// in aliases
Miladimos\FileManager\Facades\FileManagerFacade::class,
)
[comment]: <> (public function store(Request $request))
[comment]: <> ({ )
[comment]: <> ( // This will upload your file to the default folder of selected in config storage)
[comment]: <> ( UploadService::uploadBase64Image($request->input('image'));)
[comment]: <> ( // This will upload your file to the given as second parameter path of default storage)
[comment]: <> ( UploadService::uploadFile($request->input('image'), 'path/to/upload');)
[comment]: <> ( // This will upload your file to the given storage)
[comment]: <> ( UploadService::uploadFile($request->input('image'), 'path/to/upload', 'storage_name');)
[comment]: <> ( // This will also resize image to the given width and height)
[comment]: <> ( UploadService::uploadFile($request->input('image'), 'path/to/upload', 'storage_name');)
[comment]: <> (})
[comment]: <> (
use Miladimos\FileManager\Services\DirectoryService;
$service = new DirectoryService();
$service->createDirectory($name); // name of directory for create
$service->deleteDirectory($uuid); // uuid of directory for delete in db and disk
$service->listDirectories($path) // list all directories in given path
$service->listDirectoriesRecursive($path); // list all directories in given path Recursively
use Miladimos\FileManager\Services\FileService;
$service = new FileService(); // or resolve(FileService::class)