I am returning all shipping address saved by user but there are some values which are left blank and output comes as null in those. How can i convert NULL values to blank (" "). I have looked many solutions on internet but not able to get make it working. API link:
https://androidapp.factory2homes.com/api/shippings/3
$address = DB::table('shippings')->where('user_id' , $user_id)->get();
return $address;
addressa true eloquent model, for example modelShipping. Return that model in a response, either by simply returning the model or by returning a model resource. Either way, internally laravel calls several functions to get the attribute values. You have the ability to access these attributes, turning null values into blanks. See laravel.com/docs/7.x/eloquent-mutators#defining-an-accessor