Skip to content

Media gallery with CKEditor, TinyMCE and Summernote support. Built on Laravel file system.

License

Notifications You must be signed in to change notification settings

TawasolBA/laravel-filemanager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-filemanager

Overview

Fork from tsawler/laravel-filemanager, add mechanism to restrict users to see only their own folders. The original functions support image and file upload, this package only modifies the image functions.

Requirements

This package requires "intervention/image": "2.*", in order to make thumbs, crop and resize images.

Installation

  1. Run composer require intervention/image

  2. Run composer require unisharp/laravel-filemanager

  3. Edit config/app.php :

    Add this in service providers

        Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
        Intervention\Image\ImageServiceProvider::class,

    And add this in class aliases

        'Image' => Intervention\Image\Facades\Image::class,
  4. Publish the package's config and assets :

        php artisan vendor:publish --tag=lfm_config
        php artisan vendor:publish --tag=lfm_public
    
  5. Fill user_field with your user slug in config/lfm.php :

        'user_field' => "\Auth::user()->name",
    
  6. View initiation

        <script>
            CKEDITOR.replace( 'editor', {
                filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images'
            });
        </script>

    Or initiate using ckeditor jquery adapter

        <script>
            $('textarea').ckeditor({
                filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images'
            });
        </script>
  7. Ensure that the files & images directories are writable by your web server

Customization

  1. To use your own route, edit config/lfm.php :

        'use_package_routes' => false,
  2. To disable multi-user mechanism, dit config/lfm.php :

        'allow_multi_user' => false,
  3. To specify upload directory, edit config/lfm.php :

        'images_dir'         => 'public/vendor/laravel-filemanager/images/',
        'images_url'         => '/vendor/laravel-filemanager/images/',
  4. If the route is changed, make sure filebrowserImageBrowseUrl is correspond to your route :

        <script>
            CKEDITOR.replace( 'editor', {
                filebrowserImageBrowseUrl: '/your-custom-route?type=Images'
            });
        </script>

    And be sure to include the ?type=Images parameter.

  5. To customize the views, run php artisan vendor:publish --tag=lfm_views

About

Media gallery with CKEditor, TinyMCE and Summernote support. Built on Laravel file system.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 74.6%
  • HTML 13.5%
  • JavaScript 9.1%
  • CSS 2.7%
  • Makefile 0.1%