assume I have a Vue component like this
export default {
created() {
axios.get("a url").then(res => {
console.log(res.data);
});
}
};
and then axios send request to this function in laravel controller
public function something()
{
$data = Model::all();
$comments = Comment::all();
// here i want to send both $data and $comments to that view
return response()->json();
}
can i send both of them? this component and function are just an example