错误Laravel输入:获取路由Web

I have to ask something again. Here is my java script code

<script>
    $('#spiele').on('change', function(e){
        console.log(e);

        var spielID = e.target.value;

        //ajax
        $.get('/spieler-table?spielID=' + spielID, function(data){

            //success data
            console.log(data);
        });
    });
</script>

Everything works fine. But in my route web there I getting an error.

jquery-3.2.1.min.js:4 GET http://localhost:8000/spieler-table?spielID=3 500 (Internal Server Error)

Here it is...

Route::get('/spieler-table', function(){
    $testvar = Input::get('spielID');
    echo $testvar;
});

I think it is because of the var spielID which comes from my javascript code. Because the i get into the Route get and the php echo works fine with an easy string output. But when I try to Input the spielID into tester. I getting the error. Im using the laravel framework

change your script little bit :

<script>
        $('#spiele').on('change', function(e){


            var spielID = $('#spiele').val();

            //ajax
            $.get('/spieler-table?spielID=' + spielID, function(data){

                //success data
                console.log(data);
            });
        });
    </script>

change your route code like this :

Route::get('/spieler-table', function(Request $request){
        $testvar = $request->spielID;
        return $testvar;
    });