php - Temporary property for Laravel Eloquent model -


i have laravel eloquent model user, has table username , email columns. need add property model on runtime, $user->secure. property doesn't need go database.

when add property , hit $user->save() error saying don't have database column 'secure'. can unset 'secure' before save somehow feels there should better way so. suggestions?

just add attribute class.

class user extends eloquent {   public $secure;    // ... } 

note better declare protected , add corresponding accessors , mutators (getsecure , setsecure methods) model.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -