ibnujakaria/file-manager

A simple laravel file manager

V2.0.2 2021-05-25 03:52 UTC

This package is auto-updated.

Last update: 2024-10-25 11:40:26 UTC


README

Instalation

composer require ibnujakaria/file-manager

Publish Configuration and Assets

php artisan vendor:publish --provider="Ibnujakaria\FileManager\FileManagerServiceProvider"

Define routing:

# routes/web.php

\FileManager::routes();

# or you can group it wherever you want
Route::prefix('admin')->group(function () {
  \FileManager::routes();
})->middleware('auth:admin');

Basic Usage

Load Assets

<html>
  <!-- bootstrap css -->
  <link rel="stylesheet" href="dist/bootstrap.min.css">
  <!-- jquery -->
  <script src="dist/jquery.min.js"></script>
  <!-- bootstrap js -->
  <script src="dist/bootstrap.min.js"></script>

  <!-- File Manager js -->
  <script src="{{ asset('file-manager/file-manager.js') }}"></script>
</html>

Run File Manager

<!-- html -->
<div id="file-manager-app"></div>

<!-- script -->
<script>
  let fileManager = new FileManager('#file-manager-app')
  fileManager.show()
</script>

Run File Manager in Modal and pick a file

let fileManager = new FileManager()

fileManager.pickFile().then(file => {
  console.log(file.public_path)
})

// or using async/await
let fileManager = new FileManager()
let file = await fileManager.pickFile()

License

The Multiple Select Js library is open-source software licensed under the MIT License.