Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

towhid's avatar

TokenMismatchException in compiled.php line 3227: why this show on my error page ?

#what happens here ?

<form method="POST" action="/card/{{$show_cards_details->id}}/notes">
                    <div class="form-group">
                        <textarea name="body" class="form-control"></textarea>
                        
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-success">Add Note</button>
                        
                    </div>

                </form>

#when i want to add new note with input box then show this error like video

Sorry, the page you are looking for could not be found.

1/1 NotFoundHttpException in compiled.php line 8912: in compiled.php line 8912 at RouteCollection->match(object(Request)) in compiled.php line 8264 at Router->findRoute(object(Request)) in compiled.php line 8212 at Router->dispatchToRoute(object(Request)) in compiled.php line 8207 at Router->dispatch(object(Request)) in compiled.php line 2419 at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 3286 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) at call_user_func_array(array(object(CheckForMaintenanceMode), '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.........

#when i create route

Route::post('card/{show_cards_details}/notes', 'NoteController@store');

& use this Note controller function

public function store(Request $request){

        return $request->all();
}

#When i m trying to input and add then -> this is my explorer link show

http://localhost:8000/card/1/notes

#and the page error is

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(.......

#I just followed this video link --

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

same as like video i am using but the output not show what the wrong my code - i don't understand

0 likes
4 replies
CodeNathan's avatar

You didn't include you csrf protection in your form


<form method="POST" action="whatever">
    {{ csrf_field() }}
    ...
</form>
1 like
towhid's avatar

yes i add this syntax but its show

{"_token":"t73XfCVKxrqcKC9KEymwzkOCrX1Fw9dvyVM1x4t3","body":"dsdsds"}

but -- next step when i want use this code for show card details then show error again


use App\Card;
use App\Note;
use Illuminate\Http\Request;

// use App\Http\Requests;

class NoteController extends Controller
{
    public function store(Request $request Card $show_card){

            // return $request->all();

            return $show_card;

            $note = new Note;
            $note -> body = $request->body;


 



    }
}

FatalErrorException in NoteController.php line 13: syntax error, unexpected 'Card' (T_STRING), expecting ')' in NoteController.php line 13

StefanVoinea's avatar
Level 26

There is a missing coma between Request $request and Card $show_card

1 like

Please or to participate in this conversation.