Route::post('/test', '[email protected]');
아무런 인증을 추가하지 않았는대 postman에서 api를 콜하면 에러가 난다.
찾아보니까 마소에서 쿠키 남용을 막기 위해 만들었다고 하는대..;?!왜?!
아무튼 해결법은 아래와 같다.
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
use Closure;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
'/test'
];
}