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