--- tags: Backend, Laravel --- # Laravel解決使用postman post時419頁面逾時 ## 1. 將路由加入VerifyCsrfToken.php ```php= protected $except = [ // 把不要使用 csrf 的 路由 放在這裡 '/your/route/', ]; ``` ## 2. 路由放在`api.php` `api`的路由不會經過`csrf`驗證 ## 3. 帶入CSRF Token 也可以帶入CSRF Token  取得CSRF Token ```php= Route::get('/token', function () { return csrf_token(); }); ```  取得CSRF Token將他帶入header  再嘗試POST一次問題就解決啦
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up