PHPackages                             araxteam/laravel-elfinder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. araxteam/laravel-elfinder

ActiveLibrary[File &amp; Storage](/categories/file-storage)

araxteam/laravel-elfinder
=========================

A Laravel Package to integrate elFinder 2

v0.3.12(8y ago)014MITPHPPHP &gt;=5.4.0

Since Jan 16Pushed 8y agoCompare

[ Source](https://github.com/mngzir/laravel-elfinder)[ Packagist](https://packagist.org/packages/araxteam/laravel-elfinder)[ RSS](/packages/araxteam-laravel-elfinder/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (19)Used By (0)

elFinder Package for Laravel 5
------------------------------

[](#elfinder-package-for-laravel-5)

### For Laravel 4, please use the [0.2 branch](https://github.com/barryvdh/laravel-elfinder/tree/0.2)!

[](#for-laravel-4-please-use-the-02-branch)

[![Packagist License](https://camo.githubusercontent.com/c8e4db26372e7b8d2e384d0b9ff69f62ddfb02e075c6f7384028cbbc0a02cfec/68747470733a2f2f706f7365722e707567782e6f72672f62617272797664682f6c61726176656c2d656c66696e6465722f6c6963656e73652e706e67)](http://choosealicense.com/licenses/mit/)[![Latest Stable Version](https://camo.githubusercontent.com/01bfede68f4d1806663c377de552304e49e278921a5949df9f4a1095da614b0c/68747470733a2f2f706f7365722e707567782e6f72672f62617272797664682f6c61726176656c2d656c66696e6465722f76657273696f6e2e706e67)](https://packagist.org/packages/barryvdh/laravel-elfinder)[![Total Downloads](https://camo.githubusercontent.com/5a98b4c9e7e1fd2aa4bb34a1d5ae4cd1b77389ddfd4edaac627d38288e418a26/68747470733a2f2f706f7365722e707567782e6f72672f62617272797664682f6c61726176656c2d656c66696e6465722f642f746f74616c2e706e67)](https://packagist.org/packages/barryvdh/laravel-elfinder)

This packages integrates [elFinder 2.1](https://github.com/Studio-42/elFinder/tree/2.1), by making the php files available with Composer (+autoloading) and the assets with a publish command. It also provides some example views for standalone, tinymce and ckeditor. Files are updated from the a seperate [build repository](https://github.com/barryvdh/elfinder-builds)

> Note: Use `php artisan elfinder:publish` instead of the old publish command, for future changes!

### Installation

[](#installation)

Begin by installing this package through Composer. Edit your project's composer.json file to require araxteam/laravel-elfinder

```
"require": {
	"araxteam/laravel-elfinder": "dev-master"
}

```

Next, update Composer from the Terminal:

composer update

Add the ServiceProvider to the providers array in app/config/app.php

```
Barryvdh\Elfinder\ElfinderServiceProvider::class
```

You need to copy the assets to the public folder, using the following artisan command:

```
php artisan elfinder:publish

```

Remember to publish the assets after each update (or add the command to your post-update-cmd in composer.json)

Routes are added in the ElfinderServiceProvider. You can set the group parameters for the routes in the configuration. You can change the prefix or filter/middleware for the routes. If you want full customisation, you can extend the ServiceProvider and override the `map()` function.

### Configuration

[](#configuration)

The default configuration requires a directory called 'files' in the public folder. You can change this by publishing the config file.

```
php artisan vendor:publish --provider='Barryvdh\Elfinder\ElfinderServiceProvider' --tag=config

```

In your config/elfinder.php, you can change the default folder, the access callback or define your own roots.

### Views

[](#views)

You can override the default views by copying the resources/views folder. You can also do that with the `vendor:publish` command:

```
php artisan vendor:publish --provider='Barryvdh\Elfinder\ElfinderServiceProvider' --tag=views

```

### Using Filesystem disks

[](#using-filesystem-disks)

Laravel 5 has the ability to use Flysystem adapters as local/cloud disks. You can add those disks to elFinder, using the `disks` config.

This examples adds the `local` disk and `my-disk`:

```
'disks' => [
    'local',
    'my-disk' => [
        'URL' => url('to/disk'),
        'alias' => 'Local storage',
    ]
],
```

You can add an array to provide extra options, like the URL, alias etc. [Look here](https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1#root-options) for all options.

### Using Glide for images

[](#using-glide-for-images)

See [elfinder-flysystem-driver](https://github.com/barryvdh/elfinder-flysystem-driver) for [Glide](http://glide.thephpleague.com/) usage. A basic example with a custom Laravel disk and Glide would be:

1. Add the disk to your apps config/filesystems disks:

    ```
    'public' => [
        'driver' => 'local',
        'root'   => base_path().'/public',
    ],
    ```

    > Tip: you can use the `extend` method to register your own driver, if you want to use non-default Flysystem disks
2. Create a Glide Server for your disk, eg. on the `glide/` route, using a cache path:

    ```
    Route::get('glide/{path}', function($path){
        $server = \League\Glide\ServerFactory::create([
            'source' => app('filesystem')->disk('public')->getDriver(),
        'cache' => storage_path('glide'),
        ]);
        return $server->getImageResponse($path, Input::query());
    })->where('path', '.+');
    ```
3. Add the disk to your elfinder config:

    ```
    'disks' => [
        'public' => [
            'glideURL' => '/glide',
        ],
    ],
    ```
4. (Optional) Add the `glideKey` also to the config, and verify the key in your glide route using the Glide HttpSignature.

You should now see a root 'public' in elFinder with the files in your public folder, with thumbnails generated by Glide. URLs will also point to the Glide server, for images.

### TinyMCE 4.x

[](#tinymce-4x)

You can use tinyMCE integration with the following route, which by default is `/elfinder/tinymce4`:

```
route('elfinder.tinymce4');
```

In the TinyMCE init code, add the following line:

```
file_browser_callback : elFinderBrowser
```

Then add the following function (change the `elfinder_url` to the correct path on your system):

```
function elFinderBrowser (field_name, url, type, win) {
  tinymce.activeEditor.windowManager.open({
    file: '
