I tried to solve this problem "The GET method is not supported for this route. Supported methods: POST."
var get_and_read = function () {
message = messages.shift();
//console.log(message.id);
var sender = {id: message.id, _token: ''};
$.ajax({
type: 'POST',
url: "",
data: sender
});
return message;
}
In my web.php
Route::post('/widgets/alertbox/read', 'AlertboxController@postMessage')->name('alertbox.post');
In my controller
public function postMessage(Request $request) {
$message = DB::table('message')->update('status', 'success')->where('phone_number', $request->id)->first();
if (!$message)
abort(403);
}
When function get_and_read was called
500 Internal server error
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire