Skip to content

Tag: laravel

API: Ajax post in Laravel – 403 (Forbidden)

I’m getting 403 forbidden during ajax call. This is happen only if the ajax is on app.js. If I remove from app.js and put to index.blade.php, is working perfectly. How can I make it working also on my app.js? I’ve searched a lot, and found I needed to add this $.ajaxSetup({ headers: { ‘X-CSR…

Use Laravel route in javascript?

I have a Laravel route returning a JSON, and I have a JS file that dynamically generates a table with the results in a JSON. I just need to use this JSON in my JS table. That’s all. JS code (registroCarros should receive the value from the JSON, route or whatever) My Controller (dbtest is a function in …

How to echo session variable in laravel?

I have created a session variable and it’s value in laravel blade using plane javascript. But when I am trying to get that session variable value in my blade page, it displays nothing . My codes are : Answer I guess you are putting the session variables to the normal php (cookie based) session. But you …