PHP code example of mkastoun / laravel-419-handler
1. Go to this page and download the library: Download mkastoun/laravel-419-handler library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Laravel419Handler\Traits\HandlesTokenMismatch;
use Illuminate\Session\TokenMismatchException;
class Handler extends ExceptionHandler
{
use HandlesTokenMismatch;
public function render($request, Throwable $e)
{
if ($e instanceof TokenMismatchException) {
return $this->handleTokenMismatch($request, $e);
}
return parent::render($request, $e);
}
}