Solution:
Pass your variables in the view
method instead. The with
function is for passing individual data, so it doesn’t accept an array. Example:
return view('profile.newaddress', [
'address'=>$address
]);
If you want to use with
, try it like this instead (assuming $address
in a string):
return view('profile.newaddress')->with('address', $address);