[00:00] Laravel tip for Eloquent API resources. What if you want to return some fields only based on some conditions? Then you would probably define the array and then put if statement like this. So if there's a user and if that user is admin, then we add more values to the return. But Laravel has [00:18] a shorter syntax for that. You can achieve the same result by using this when or this merge when. If we're talking about one value to be returned like phone, it could be this one, then condition, [00:31] and the value, and this would be returned only if the user is admin. If they are not admin, then that key of the phone wouldn't be present in the API return result. For multiple attributes, you can use merge when, again condition, and then array to be returned or to be merged with this [00:48] array in the beginning. For more Laravel tips and longer tutorials, subscribe to my channel, Laravel Daily.