PHP code example of iqonic / laravel-advanced-file-manager
1. Go to this page and download the library: Download iqonic/laravel-advanced-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/ */
iqonic / laravel-advanced-file-manager example snippets
use Iqonic\FileManager\Facades\FileManager;
// Upload a file
$file = FileManager::upload($request->file('avatar'));
// Create a folder
$folder = FileManager::createFolder('New Gallery');
// Get Files in a Folder
$files = FileManager::listFiles(['folder_id' => $folder->id]);
// Get URL for specific size (thumbnail, small, medium, large)
$url = $file->getVariantUrl('medium');
// Get responsive srcset for <img> tags
// Returns: "url_small.jpg 400w, url_medium.jpg 800w..."
$srcset = $file->srcset;
use Iqonic\FileManager\Models\UserPreference;
// Save a preference
UserPreference::set($user->id, 'theme', 'dark');
// Retrieve a preference
$theme = UserPreference::get($user->id, 'theme', 'light');