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_name;

Continue reading

  • 249
  • 308
  • By Bablu Ahmed
  • Posted 1 year ago