seguce92 / filemanager by seguce92

Filemanager integrator with tinyMCE for laravel framework.
29
1
3
Package Data
Maintainer Username: seguce92
Maintainer Contact: micorreoseguce@gmail.com (Sergio Gualberto Cruz Espinoza)
Package Create Date: 2017-01-19
Package Last Update: 2019-06-25
Language: JavaScript
License: MIT
Last Refreshed: 2024-11-14 15:08:17
Package Statistics
Total Downloads: 29
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

FileManager for Laravel 5.*

Installation

Laravel 5.x:

You can install the package for your Laravel 5 project through Composer.

$ composer require seguce92/filemanager

Register the service provider array in app/config/app.php.

Seguce92\Filemanager\ServiceProvider::class,

You can optionally use the facade for shorter code. Add this to your facades in array aliases:

'Filemanager' => Seguce92\Filemanager\FileManagerFacade::class,

Export setting file and resources with command:

$ php artisan vendor:publish

Configuration

To start using the file manager perform the respective configuration in the file app\config\seguce92\filemanager.php

    /**
     * PATH GLOBAL FILEMANAGER EMBED IN TINYMCE EDITOR
     * --------------------------------------------------------------
     *  Path filemanager resources
     */
    'filemanager' => '/filemanager/',

    /**
     * TITLE MODAL DIALOG
     * --------------------------------------------------------------
     *  Title of the modal dialog
     */
    'filemanager_title' => 'FileManager for Laravel with tinymce',

    /**
     * ROUTE OR URL
     * --------------------------------------------------------------
     *  Route or url
     */
    'url'	=>	'admin/filemanager/',

    /**
     * SINGLE IMPUT
     * --------------------------------------------------------------
     *  Single file manager charge in modal dialog
     */
    'single_filemanager'	=>	'filemanager/dialog.php?type=1&field_id=image-filemanager&relative_url=1',

    /**
     * FRAMEWORK STYLE
     * --------------------------------------------------------------
     * Select a use framework style (bootstrap, materializecss)
     */
    'style' =>  'bootstrap',

    /**
     * CUSTOM ICONS
     * --------------------------------------------------------------
     *  Custom icons relative style
     */
    'icons' => [
        'bootstrap' =>  [
            'select'    =>  'glyphicon glyphicon-picture',
            'clear' =>  'glyphicon glyphicon-trash'
        ],

        'materializecss'    =>  [
            'select'    =>  'photo',
            'clear' =>  'delete'
        ]
    ],

Use

Add style

{!! Filemanager::style() !!}

Add script

{!! Filemanager::script() !!}

Embend in TinyMCE 4 Editor

  1. First add the style and script directives

  2. In the content section use the directive

    {!! Filemanager::textarea('title for label') !!}
    
  3. In the script section use the directive

    {!! Filemanager::tinymce() !!}
    

Single input with Dialog Responsive Filemanager

  1. First add the style and script directives

  2. In the content section use the directive

    {!! Filemanager::input('title for label') !!}
    

Example

@extends('layouts.app')

@section('style')
    {!! Html::style('path/to/bootstrap.min.css') !!}
    {!! Filemanager::style() !!}
@endsection

@section('content')
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="form-group">
                <label for="title">title</label>
                <input type="text" name="title" id="title" class="form-control">
            </div>
            {!! Filemanager::textarea('content') !!}

            {!! Filemanager::input('image') !!}

            <div class="form-group">
                <a href="{{ url('/') }}" class="btn btn-danger">CANCEL</a>
                <button type="submit" class="btn btn-success">SAVE</button>
            </div>
        </div>
    </div>
@endsection

@section('script')
    {!! Html::style('path/to/jquery.min.js') !!}
    {!! Html::style('path/to/bootstrap.min.css') !!}
    {!! Filemanager::script() !!}
    {!! Filemanager::tinymce() !!}
@endsection

Information and Details

visit site mascodigo.net