Hello Friend,
In laravel sometime we need to remove some URL or route from X-CSRF-TOKEN Protection. you have to add your URL in "VerifyCsrfToken" Middleware. add you URL in "$except" array variable.
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
// direct link example
'https://www.laravelcode.com',
'https://www.laravelcode.com',
// if you want add post route then please add here route's name.
'users.store',
];
}
I hope it can help you...
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to Check If a Value Exists in an Array in JavaScript
Use the indexOf() Method You can use...How to check request is ajax or not in Laravel
In this tutorials we will share with you...Laravel 8 WHERE Like Query Example Tutorial
When you put the search form in your app...Difference between private, public, and protected modifiers in PHP
If you have worked in object orient prog...How to install ATOM text editor in Ubuntu and Windows
Atom is hackable, modern and open-s...