[How to Solve] Laravel Ajax request error: 419 unknown status

Guide: use the laravel framework to return the error page when using Ajax for image upload request, and prompt 419 unknown status solution

419 unknown status has three solutions:

First, comment out CSRF validation in kernel.php, which is not recommended

'web' => [
            // \Illuminate\Session\Middleware\AuthenticateSession::class, 
            // \App\Http\Middleware\VerifyCsrfToken::class, 
            // \Silber\PageCache\Middleware\CacheResponse::class,
            // \App\Http\Middleware\VistLog::class

Second: write the interface to route/API. PHP

The third method is to add in the request parameters when uploading the request_ Token parameter


Similar Posts: