Laravel 5: Ajax Post 500 (Internal Server Error)

前端 未结 5 800
终归单人心
终归单人心 2020-12-10 07:54

I\'m trying to submit data to the database via ajax. The submit article page works fine without ajax. I\'ve added console.log() just to see if anything is going

5条回答
  •  隐瞒了意图╮
    2020-12-10 08:24

    I like to share this code to help someone to need ajax post and get with laravel

    <<<<<<<<
    POST
    <<<<
    <
    @section('content')
      
    -------------0---------------------- -------------0---------------------- <<<----<name('login4'); ------------------0---------------------- ------------------0---------------------- <<<< Get < @section('content')
    -------------0---------------------- -------------0---------------------- <<<----<name('login2'); -------------0---------------------- -------------0---------------------- <<<----<isMethod('get')) { return response()->json(['response' => 'This is get method']); } return response()->json(['response' => 'This is post method']); } -------------0---------------------- -------------0----------------------

提交回复
热议问题