Eloquent

One of the many useful features of Eloquent is the ability to define accessors and mutators. Mutators can help you if there's something you'd like to do with a value (like hashing a password) every time it gets set on your model. Accessors are for doing something every time you retrieve an attribute (like converting markdown to HTML). You can even use an accessor to dynamically create additional properties on your model (like a full name that concatenates first and last names). Those are great features, but we also have attribute casting so we can convert attributes to common data…