You can't, there is no collection. But you already know the model name.
Sep 2, 2018
5
Level 1
Get model's class name from eloquent collection even if the query does not return any results
Say there are no users in the system yet and I am running this query:
$users = User:all();
How do I resolve the model's class name from the $users collection even if it does not return any results?
Please or to participate in this conversation.