Whoops, looks like something went wrong.
TokenMismatchException in VerifyCsrfToken.php line 68:
in VerifyCsrfToken.php line 68
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148
/var/www/home.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php#68
57 public function handle($request, Closure $next)
58 {
59 if (
60 $this->isReading($request) ||
61 $this->runningUnitTests() ||
62 $this->inExceptArray($request) ||
63 $this->tokensMatch($request)
64 ) {
65 return $this->addCookieToResponse($request, $next($request));
66 }
67
68 throw new TokenMismatchException; //<== 이곳이 오류라고 합니다.
69 }
이런 오류가 발생합니다. 이유가 뭔지 도저히 알수가 없네요. ㅠㅠ;;; 도움좀 부탁드립니다.
View쫌 폼 소스입니다.
<form method="POST" action="{{ route('articles.store') }}">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group{{ $errors->has('title') ? ' has-error' : '' }}">
<label for="title">제목</label>
<input id="title" type="text" class="form-control" name="title" value="{{ old('title') }}">
{!! $errors->first('title', '<span class="form-error">:message</span>') !!}
</div>
<div class="form-group{{ $errors->has('content') ? ' has-error' : '' }}">
<label for="title">본문</label>
<textarea id="content" rows="10" class="form-control" name="content">
{{ old('content') }}
</textarea>
{!! $errors->first('content', '<span class="form-error">:message</span>') !!}
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">
저장하기
</button>
</div>
</form>
Controller쪽 소스입니다.
public function create()
{
return view('articles.create');
}
public function store(Request $request)
{
$rules = [
'title' => 'required',
'content' => 'required|min:10',
];
$validator = \Validator::make($reuest->all(), $rules);
return __METHOD__ . '은(는) 사용자의 입력한 폼 데이터로 새로운 Article 컬렉션을 만듭니다.';
}