I´m in my last phases of my proyect and I´m building a secure app. My doubt here is, I want to be very careful about the security of the table "users", so in my querys I only select the columns that the view need to show, for example the name or the age. But users is related to a table (one to many) and when I query that table (the related one), I can access all the columns in users, and at least I want to protect the password. ¿Is there any way to "hide" the password column from all others querys? Here is the example if it can help: //This shows the user pwd
$top = top_semanal::where('sport',$category)->get();
$top[0]->user->password
//This doesnt
$usuario = user::select('user','email')->where('id', 1)->first();
$usuario->password;
Important detail: I´m not using auth, just my own models. This is my model "user"
protected $table = "USER";
public $timestamps = false;
protected $fillable = [
'name',
'email',
'password',
];
protected $hidden = [
"password"
];
Thank you!