I will often use Tinker to look at the first record...
php artisan tinker
>>> User::first();
Having worked with Symfony, I have a question about Eloquent Models. In Symfony all the attributes are right there in the Model/Entity class so you get auto-completion and you know what fields your Model has without having to open your database and look at the columns.
Symfony:
class User extends ...
{
private $username;
private $password;
private $street_address;
private $phone_number;
private $created_at;
private $updated_at;
}
But in Laravel you do not see these fields on Model itself.
class User extends Model
{
}
Which means you get no auto-completion and you do not know what fields you have unless you open your database, go to the table and look at the columns. Or you have to trace it through all the different migrations for that table.
Or am I missing something here?
I believe you should be able to add this above your class. But I think most people use Laravel Idea https://plugins.jetbrains.com/plugin/13441-laravel-idea
/**
* @property string $username
* @property string $password
*/
Please or to participate in this conversation.