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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -