PHP code example of nordsoftware / lumen-file-manager

1. Go to this page and download the library: Download nordsoftware/lumen-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/ */

    

nordsoftware / lumen-file-manager example snippets


$app->register('Nord\Lumen\FileManager\Doctrine\ORM\DoctrineServiceProvider'); // For ORM
// $app->register('Nord\Lumen\FileManager\Doctrine\ODM\DoctrineServiceProvider'); // For ODM
$app->register('Nord\Lumen\FileManager\FileManagerServiceProvider');

public function uploadFile(Request $request, FileManager $fileManager)
{
    $file = $fileManager->saveFile($request->file('upload'));

    return Response::json([
        'id' => $file->getId(),
        'url' => $fileManager->getFileUrl($file),
    ]);
}
bootstrap/app.php