title: Trouble installing tinyMCE and UniSharp/laravel-filemanager
body: <p>So Im trying to install tinyMCE with image upload. I successfully install tinyMCE for simple styling but I cant make the image upload to work. I try to installed UniSharp/laravel-filemanager but when I click on the img icon this is what I get</p>
  
  <p><a href="http://i.stack.imgur.com/tZ9hq.png" rel="nofollow">Sorry page not found</a></p>
  
  <p><a href="http://i.stack.imgur.com/wG6lM.png" rel="nofollow">Console</a></p>
  
  <p>I think somthing is wrong with the cmsURL</p>
  
  <p>This is the index.blade.php</p>
  
  <pre><code>@extends('templates.layout')
  
  @section('head')
    &lt;script src="/wysiwyg/public/js/tinymce/tinymce.min.js"&gt;&lt;/script&gt;
    &lt;script&gt;
      var editor_config = {
        path_absolute : "{{ URL::to('/') }}/",
        selector : "textarea",
        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.getElementByTagName('body')[0].clientWidht;
          var y = window.innerHeight|| document.documentElement.clientHeight|| document.grtElementByTagName('body')[0].clientHeight;
          var cmsURL = editor_config.path_absolute+'laravel-filemanaget?field_name'+field_name;
          if (type = 'image') {
            cmsURL = cmsURL+'&amp;type=Images';
          } else {
            cmsUrl = cmsURL+'&amp;type=Files';
          }
  
          tinyMCE.activeEditor.windowManager.open({
            file : cmsURL,
            title : 'Filemanager',
            width : x * 0.8,
            height : y * 0.8,
            resizeble : 'yes',
            close_previous : 'no'
          });
        }
      };
  
      tinymce.init(editor_config);
    &lt;/script&gt;
  @stop
  
  @section('body')
    &lt;h1&gt;Hello&lt;/h1&gt;
    &lt;form method="post" action="addpost"&gt;
      {{ csrf_field() }}
      &lt;textarea name="body"&gt;&lt;/textarea&gt;
      &lt;button type="submit"&gt;Submit&lt;/button&gt;
    &lt;/form&gt;
  
  @stop
  </code></pre>
  
  <p>This is the routs </p>
  
  <pre><code>Route::get('/', 'HomeController@index');
  Route::post('/addpost', 'HomeController@addPost');
  Route::get('/{post}', 'HomeController@post');
  </code></pre>
  
  <p>And this is the home controller </p>
  
  <pre><code>namespace App\Http\Controllers;
  
  use App\Post;
  
  use Illuminate\Http\Request;
  
  use App\Http\Requests;
  
  class HomeController extends Controller
  {
      public function index()
      {
        return view('index');
      }
  
      public function post(Post $post)
      {
        return view('post', compact('post'));
      }
  
      public function addPost(Request $request)
      {
        $post = new Post;
        $post-&gt;body = $request-&gt;body;
        $post-&gt;save();
  
        return back();
      }
  }
  </code></pre>
  
  <p>and I have ony one model Post</p>
  
  <pre><code>namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Post extends Model
  {
      protected $fillable = ['body'];
  }
  </code></pre>