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