Вы не добавили данные для отправки из Laravel в Ajax Controller. Вы можете передавать данные внутри объекта данных, как
$.post({
url: '/permisos',
type: "POST",
data: {
id: '{{$user->id}}' // Suppose you need to pass the user id to the controller
},
async: false,
success: (res) => {
console.log(res)
}
});
При получении идентификатора в AjaxController вы можете просто использовать переменную Request $ request.
public function getPermissions(Request $request)
{
//dd($request->all())
//dd can be use to die and dump the all variable values
return $request->id;
}
При просмотре в консоли отобразится Ajax Request Id.