Eloquent Accessors & Mutators OR Custom Attributes

The accessor and mutator both are the public functions of Laravel model for getting and setting model's attributes.

An accessor will automatically be called by Eloquent when attempting to retrieve the value of the first_name attribute:

$fullName = $user->full_nam [...]

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 2 years ago