I would like to do something very simple but I can't make it work, I only want to send via jquery ajax a multi dimensional array to laravel and get the data back.
For example:
var info = JSON.stringify([{'key':'val1'},{'key':'val2'},{'key':'val3'}]);
$.ajax({
type: "POST",
url: "{!! route('ajaxactivityperemployee') !!}",
data: {"mydata":info},
success: function(msg){
console.log(msg);
}
On the other side, on my controller, I try this:
public function postActivityPerEmployee(Request $request)
{
$input = $request->all();
return $input['mydata'][0]['key'];
}
I ve tried various combinations but I always end up with a 500 page error or in the console, I only get [ and nothing else.