Hi guys, We all know that Laravel's Eloquent is using PHP's magic methods (__get & __set) for the columns, accessors, relationships,... and much more. When the development happens, it hards for us to know which "properties" that we can use for a particular Eloquent models. We have to remember the columns' names, the relationship names,...

An alternative that we got - is using the phpDoc block and add the properties, eg: /** * @property-read int $id // column * @property string $name // column * @property-read Country|null $country // relationship *... */ class User extends Model {

Laravel auto-discovery will automatically do the magic 😉 #usage Usage #view-properties-of-your-model View properties of your model php artisan eloquent:phpdoc App\Models\User
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners