laravel use field in Eloquent model from another table -


i have model named "user". want "password" field eloquent table, , when user calls user::all() method, selected fields different tables come in result. how can that?

results not displayed in with() .

my problem solved using $appends in eloquent model .

my code :

class user extends eloquent { protected $table = 'user'; protected $attributes = ['password']; protected $appends = ['password']; public function getpasswordattribute() {     return $this->getpasswordmethod();   } } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -