PHPnews.io

Overview for 'bosnadev'


Laravel Accessors and Mutators

Written by Bosnadev – Code Factory / Original link on Dec. 17, 2015

Laravel accessors and mutators are custom, user defined methods that allow you to format Eloquent attributes. Accessors are used to format attributes when you retrieve them from the database, while mutators format the attributes before saving them to the database.Defining an accessorSyntax for defi…