Laravel 5.1 - 当站点在线时,Ajax错误POST 500

I have a problem with my AJAX call on my laravel 5.1 website.

when I run the site locally it works without any problems. However when I run the site online I get an error

error

The link of the page is enter image description here

here's the code I use for the ajax function

$('.articleFavo').click(function(e){
    e.preventDefault();
    var userid= $('input[name=userID]' ).val();
    var functionType = 'favorite';
    var articleid=$('input[name=articleId]').val();
    var token=$('input[name=_token]').val();

    $.ajaxSetup({headers : {'X-CSRF-TOKEN' : $('meta[name="csrf-token"]').attr('content')}});

    $.ajax({
        url:articleid,
        type: "post",
        data:
        {
            'functionType': functionType,
            'user_id': userid,
            'article_id': articleid,
            '_token': token
        },
        success: function(){
            console.log(articleid);
            $('#favoriteBtn'+ articleid).css({display: 'none'})
            $('#unfavoriteBtn'+ articleid).fadeIn();
        }
    });
});

and here is my PHP code

    elseif($functionType == 'favorite')
    {
        $user_id = Auth::user()->id;
        $article_id = input::get('article_id');

        $results = DB::select("select *
                       from favorites
                       where user_id = $user_id AND article_id = $article_id");
        $articleDetails = DB::select("select *
                       from articles
                       where id = $article_id");

        if ($results == null){
            $favorite = new favorite();
            $favorite->user_id = $user_id;
            $favorite->article_id = $article_id;
            $favorite->save();

            $notification = new Notification();
            $notification->user_id = $articleDetails[0]->user_id;
            $notification->save();
        }else{
            echo "You already added this as a favorite!";

} }