1

I am trying to work with LTI specification, so I register a launch URL on Moodle pointing to my Laravel Application. But I'm getting a 419 status error.

My web.php:

Route::post('/lti', 'PagesController@lti');

My launch URL:

localhost/projectlaravel/public/lti

Anyone could help?

curveball
  • 4,320
  • 15
  • 39
  • 49
Eduardo K.
  • 11
  • 1

1 Answers1

0

Use this in the head section of your blade file:

<meta name="csrf-token" content="{{ csrf_token() }}">

and get the csrf token in ajax:

$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});

Please refer Laravel Documentation csrf_token

Pusparaj
  • 1,469
  • 1
  • 12
  • 19