mercredi 17 janvier 2018

get item type of an Eloquent collection in Laravel

I am trying to find the best way to retrieve the Eloquent Model type of items in a collection.

Of course I can get the first item and ask for its type, but it's likely that I hit an empty collection and there's no other way to get the type then. This question is similar to this one here C# - Get the item type for a generic list but I couldn't find any addressing this for laravel or php.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2Dhvry4
via IFTTT

Aucun commentaire:

Enregistrer un commentaire