Guest User

Untitled

a guest
Jan 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. protected $fillable = [
  2. 'fname','lname'
  3. ];
  4.  
  5. /**
  6. * The attributes that should be hidden for arrays.
  7. *
  8. * @var array
  9. */
  10. protected $table = 'employees';
  11.  
  12. protected $guarded = array('id', 'password');
  13. public static $rules = array(
  14. 'fname' => 'required',
  15. 'lname' => 'required'
  16. );
  17.  
  18. /**
  19. * Make sure that first name is capitalized BEFORE saving it to the database
  20. *
  21. * @param $value
  22. * @return string
  23. */
  24. public function setFnameAttribute($value)
  25. {
  26. $this->attributes['fname'] = ucfirst($value);
  27. }
  28.  
  29. /**
  30. * Make sure that last name is capitalized BEFORE saving it to the database
  31. *
  32. * @param $value
  33. * @return string
  34. */
  35. public function setLnameAttribute($value)
  36. {
  37. $this->attributes['lname'] = ucfirst($value);
  38. }
Add Comment
Please, Sign In to add comment