towhid
387
7
Laravel

TokenMismatchException in compiled.php line 3227

Posted 2 years ago by towhid

use this code on my edit page

<form method="POST" action="/note/{{$show_card_note->id}}">
                    {{ method_field('PATCH') }}
                    <div class="form-group">
            <textarea name="body" class="form-control">{{$show_card_note->body}}</textarea>
                        
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-success">Update Note</button>
                        
                    </div>

                </form>

this code use my route

Route::patch('note/{show_card_note}', '[email protected]');

use this code Note controller

public function edit(Note $show_card_note){

            return view ('note.edit', compact('show_card_note'));
    }

    public function update(Request $request, Note $show_card_note){


            $show_card_note->update($request->all());

            return back();
        }

please tell me what my wrong i am follow this video link

visit https://laracasts.com/series/laravel-5-from-scratch/episodes/10

THE ERROR SHOW -------

Whoops, looks like something went wrong.

1/1
TokenMismatchException in compiled.php line 3227:
in compiled.php line 3227
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 13474
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 11964
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.