Unisharp laravel文件管理器NotFoundHttpException

时间:2017-09-14 06:06:11

标签: php laravel tinymce-4 file-manager

请帮我解决unisharp laravel文件管理器..我的版本Laravel 5.4.36和tinymce-4.6.6 我只是按照说明操作,但尝试了其他方法,例如将resulta放在Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,的顶部..但仍然有此错误... enter image description here

那里有一些可以帮助我吗?..

非常感谢你

1 个答案:

答案 0 :(得分:0)

我只使用选项2:TinyMCE4

然后将path_absolute : "/",更改为path_absolute : "{{ URL::to('/') }}/", enter image description here

基本上这是我的整个代码......

@extends('layouts.app')

@section('content')
<div class="container top-space">
    <div class="row" >
        <div class="container weldiv">
            <span class="welcomeh1">Add Article and Announcement</span>
        </div>
    </div>
    <div class="row top-space">
        <div class="container weldiv">
            <div class="col-md-9 col-md-offset-1">
                <form class="form-horizontal" role="form" method="POST" action="{{ route('add_article_announcement.post') }}">
                    {{ csrf_field() }}
                    <div class="form-group{{ $errors->has('article_title') ? ' has-error' : '' }}">
                        <label for="article_title" class="col-md-4 control-label">Article Title</label>
                        <div class="col-md-6">
                            <input id="article_title" type="text" class="form-control" name="article_title" value="{{ old('article_title') }}" required autofocus>
                            @if ($errors->has('article_title'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('article_title') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-group{{ $errors->has('article_content') ? ' has-error' : '' }}">
                        <label for="article_content" class="col-md-4 control-label">Article Content</label>
                        <div style="padding: 10px">

                            <textarea name="article_content" class="form-control my-editor">{!! old('article_content') !!}</textarea>
                            @if ($errors->has('article_content'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('article_content') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    @if(session()->has('message'))
                            <div class="alert alert-success">
                                {{ session()->get('message') }}
                            </div>
                        @endif
                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary">
                                    Submit
                                </button>
                                <a href='' class="btn btn-primary">
                                    Cancel
                                </a>
                            </div>
                        </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
  var editor_config = {
    path_absolute : "{{ URL::to('/') }}/",
    selector: "textarea.my-editor",
    plugins: [
      "advlist 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"
      });
    }
  };

  tinymce.init(editor_config);
</script>

@endsection