I just had a similar issue but with Laravel 7.26.x. Issue related to the CSRF Token.
On my swagger blade I removed from the body
requestInterceptor: function () {
this.headers['X-CSRF-TOKEN'] = '{{ csrf_token() }}';
return this;
},
and added instead
<meta name="csrf-token" content="{{ csrf_token() }}">
Also don't forget to add in your web routes
Route::group(['middleware' => 'web'], function () {
Route::get('api/documentation', '\L5Swagger\Http\Controllers\SwaggerController@api')->name('l5swagger.api');
});