title: Laravel: TinyMCE Upload Images
body: <p>I want to upload images insinde the TinyMCE editor. I found instructions for that <a href="https://www.tinymce.com/docs/get-started/upload-images/" rel="noreferrer">in the docs</a>. </p>
  
  <p>These are my Javascript settings:</p>
  
  <pre><code>tinymce.init({ 
         selector: '#about',          
         images_upload_url: '/home/profile/about/img',
       });
  
  tinymce.activeEditor.uploadImages(function(success) {
        $.post('/home/profile/about/img', tinymce.activeEditor.getContent()).done(function() {
          console.log("Uploaded images and posted content as an ajax request.");
        });
      });
  </code></pre>
  
  <p>I created the following route to check if everything is setup correctly</p>
  
  <pre><code>Route::post('/home/profile/about/img', function(){
   return json_encode(['location' =&gt; '/storage/app/public/pictures/bestAvatar.png' ]);
  });
  </code></pre>
  
  <p>I expected that when I upload an image nothing will be uploaded and the image <code>bestAvatar.png</code> is shown - however instead I get an error:</p>
  
  <p><a href="https://i.stack.imgur.com/8Wh5O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8Wh5O.png" alt="enter image description here"></a></p>
  
  <p>Am I missing anything? Is it maybe because there is no default csrf token in the tinymce ajax call?</p>