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 - Feed FileReader from server side files -

How to Change swipe Tab Title color in java Android -

Using globs in Perl replace one liner in TCL script -