500 internal server error using jquery and ajax in laravel 5.2
<p>I am building edit post system using jquery and ajax in laravel 5.2. When i click on save changes button in my bootstrap modal, the following error is displayed:</p>

<blockquote>
  <p>Error: POST <a href="http://localhost:8000/edit" rel="nofollow">http://localhost:8000/edit</a> 500 (Internal Server Error)</p>
  
  <p>send @ jquery-1.12.0.min.js:4 </p>
  
  <p>ajax @ jquery-1.12.0.min.js:4   (anonymous function) @ myplace.js:24 </p>
  
  <p>dispatch @ jquery-1.12.0.min.js:3 </p>
  
  <p>r.handle @ jquery-1.12.0.min.js:3</p>
</blockquote>

<p>js code:</p>

<pre><code>$('#modal-save').on('click' , function() {

 $.ajax({

 method : 'POST' ,
 url : url ,
 data: { body: $('#post-body').val(), postid: '' , _token: token }})

.done(function(msg) {

console.log(msg['message']);

    });
  });
</code></pre>

<p>Included in view file:</p>

<pre><code>    &lt;script&gt;
    var token='{{ Session::token() }}';
    var url='{{  route('edit') }}' ;
  &lt;/script&gt;


 &lt;script   src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.1/jquery.min.js"&gt;&lt;/script&gt;

 &lt;script   src="https://code.jquery.com/jquery-migrate-1.2.1.min.js" &gt;&lt;/script&gt;
   &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"&gt;&lt;/script&gt;
  &lt;script src="src/js/myplace.js"&gt;&lt;/script&gt;
</code></pre>