Answer the question
In order to leave comments, you need to log in
Why might $except in \Middleware\VerifyCsrfToken not work in Laravel?
routes/web.php has this code
Route::match(['get','post'], '/api', 'Api\[email protected]');
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class ApiController extends Controller
{
public function index(Request $request) {
echo '123';
}
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier
{
protected $except = [
'/api'
];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question