in your User model u can specify hidden variable with fields you don't want to show.
protected $hidden = [
'password',
'remember_token']
now
$user = User::find(1);
I have a User Model with columns id, name, email, uuid, password,address,state,city,timestamps
What i am doing is
User::select('id', 'name', 'email', 'uuid')->find(1);
Problem
Now the problem is that every time i am querying on this model i have to specify columns because i don't need other columns (in most cases).
Question
Is there any method by which i can select columns by default. So that every time when i call user model it will load basic columns id, name, email, uuid automatically. ?
Please or to participate in this conversation.