Laravel FileManager不起作用,使用TinyMCE4

时间:2019-01-23 19:12:07

标签: laravel file-manager

出什么问题了? Filemanager不显示。我愿意:

https://github.com/UniSharp/laravel-filemanager

在终端上安装FileManager

 composer require unisharp/laravel-filemanager:dev-master

config app.app

 'providers' => [
     Unisharp\LaravelFilemanager\LaravelFilemanagerServiceProvider::class,
     Intervention\Image\ImageServiceProvider::class,
  ],

 'aliases' => [
     'Image' => Intervention\Image\Facades\Image::class,
  ],

create.blade.php

<script src="{{ URL::to('js/tinymce/tinymce.min.js')}}"></script>
<script>
        var editor_config = {
            path_absolute : "{{ URL::to('/') }}",
            selector: "textarea",
            plugins: [
                "adylist autolink lists link image charmap print preview hr anchor pagebreak",
                "searchreplace wordcount visualblocks visualchars code fullscreen",
                "insertdatetime media nonbreaking save table contextmenu directionality",
                "emoticons template paste textcolor colorpicker textpattern"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media",
            relative_urls: false,
            file_browser_callback : function(field_name, url, type, win){
                var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
                var y = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
                var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name' + field_name;
                if(type == 'image') {
                    cmsURL = cmsURL + "&type=Images";
                } else {
                    cmsURL = cmsURL + "&type=Files";
                }

                tinymce.activeEditor.windowManager.open({
                    file : cmsURL,
                    title: 'Filemanager',
                    width : x * 0.8,
                    height : y * 0.8,
                    resizable : "yes",
                    close_previous : "no"
                });

            } 
        };

      https://drive.google.com/open?id=18I4CnnSP2bM_4FihicJq0p0qg05Cip0d  tinymce.init(editor_config);
</script>

php artisan供应商:在终端上发布

Imgur

路由web.php

 Route::get('/', function () {
     return view('welcome');
 });

 Route::group(['middleware' => 'auth'], function () {
     Route::get('/laravel-filemanager', '\UniSharp\LaravelFilemanager\Controllers\LfmController@show');
     Route::post('/laravel-filemanager/upload', '\UniSharp\LaravelFilemanager\Controllers\UploadController@upload');
 });

结果:

Imgur

Imgur

:(

0 个答案:

没有答案