You can shorten the array in the resource instead. The great thing about the resource, is you can make 1 resource and return it everywhere. For places like lists and cards where you won't use all the data, you can make a summarized resource.
How could i removed specific KEY Values from data (Items) , for in your JSON example i want to remove "City" from your result than how could it possible ?
If you’re using the same project as me. Simply remove it from the people api resource file we created. By the looks of your other comment you have a different project open so I’m not sure what the answer is.
@@QuentinWatt Hi , Thanks for fast reply and yes it's not in your tutorial but i follow your tutorial and fetch data from my database , in my DB i have username, dob & image (blob data) so i need your help to fetch those data. Your help highly Appreciated!
You can set a unique slug field in the database and use that as the route key with function getRouteKeyName() laravel.com/docs/8.x/routing#implicit-binding
can i get your social media contact?, i want to ask you something urgent, I am very troubled, and I will be very happy if you want to help me, Thank you for making this video before,
Best tutorials ever
Thank you very much
Thank you 😊 glad you like them
Superb Explanation :) Great Tutorial, thank you so much for putting in so much time and effort.
Thank you watching. I'm glad it helped. 😬
well actually i don't use this Resource because:
you can use this to make arrays from data, where
the result:
{
"room": {
"id": 4,
"user_id": 4,
"name": "Macedonia Palace",
"city": "Thessaloniki",
"area": "GEvGCHN2WMasd",
"photo": "images/room-4.jpg",
"room_type": "Single Room",
"count_of_guests": 1,
"price": 85,
"location": "asdasdasdasdasd",
"lat_location": 31.48,
"lng_location": 93.27,
"short_description": "C1askfYfChm3PHJl97c9nr7trcKR2rYzHEqliaPPIjCLzbd1nM",
"long_description": "K1d8WD8U8G",
"parking": "No",
"wifi": "Yes",
"pet_friendly": "No",
"created_at": "2019-03-16 17:46:37",
"updated_at": "2019-03-30 09:14:57"
},
"title": "Macedonia Palace"
}
return [
'room' => $room,
'title' => $room->name,
];
There are many different ways to go about it, but a resource is quite well structured so it's just the way I like to work.
You can shorten the array in the resource instead.
The great thing about the resource, is you can make 1 resource and return it everywhere. For places like lists and cards where you won't use all the data, you can make a summarized resource.
How could i removed specific KEY Values from data (Items) , for in your JSON example i want to remove "City" from your result than how could it possible ?
If you’re using the same project as me. Simply remove it from the people api resource file we created.
By the looks of your other comment you have a different project open so I’m not sure what the answer is.
@@QuentinWatt I solved that issue by using
protected $hidden = [
'logo'
];
in my model file.
I am getting BLOB data in my result how can i change those data in base64, i got an error of UTF-8 character
This wouldn’t be from my tutorial.
If it’s stored in the database as a blob you can covert it with a helper function.
@@QuentinWatt Hi , Thanks for fast reply and yes it's not in your tutorial but i follow your tutorial and fetch data from my database , in my DB i have username, dob & image (blob data) so i need your help to fetch those data. Your help highly Appreciated!
hello thank u very much! i d like to ask one question, how to use string variables as a dynamic route instead of id? like instagram.com/username
You can set a unique slug field in the database and use that as the route key with function getRouteKeyName()
laravel.com/docs/8.x/routing#implicit-binding
que laravel broda ?
Thank you very much
very useful
You are welcome
can i get your social media contact?, i want to ask you something urgent, I am very troubled, and I will be very happy if you want to help me, Thank you for making this video before,
There are social media links in the description of every video :)