Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected $fillable = [
- 'fname','lname'
- ];
- /**
- * The attributes that should be hidden for arrays.
- *
- * @var array
- */
- protected $table = 'employees';
- protected $guarded = array('id', 'password');
- public static $rules = array(
- 'fname' => 'required',
- 'lname' => 'required'
- );
- /**
- * Make sure that first name is capitalized BEFORE saving it to the database
- *
- * @param $value
- * @return string
- */
- public function setFnameAttribute($value)
- {
- $this->attributes['fname'] = ucfirst($value);
- }
- /**
- * Make sure that last name is capitalized BEFORE saving it to the database
- *
- * @param $value
- * @return string
- */
- public function setLnameAttribute($value)
- {
- $this->attributes['lname'] = ucfirst($value);
- }
Add Comment
Please, Sign In to add comment