My purpose is :
- Getting clicked button's id
- Post this id number to a controller's method.
Note that my routes are working nice. But when i try to pass data, i am having problems.
Here is jQuery :
$.ajax({
type: "POST",
url : "myRouteURL",
data: (jQuery(this).attr("id"))
});
Here is my controller's method :
public function somethingSpecial($passedData){
DB::table('myTableName')->where('fieldName', '=', $passedData)->delete();
}
Thanks in advance.