`
class User extends Model
{
/*
* Get the user's first name.
* @param string $value
* @return string
*/
public function getDateOfBirthAttribute($value)
{
return Carbon::parse($value)->format('m/d/Y');
}
/**
* Get the user's first name for forms.
*
* @param string $value
* @return string
*/
public function formDateOfBirthAttribute($value)
{
return Carbon::parse($value)->format('Y-m-d');
}
https://laravelcollective.com/docs/5.2/html#form-model-accessors The following parts' comments are both wrong. The funciton are used to "get the date_of_birth" instead of "Get the user's first name."
` class User extends Model { /* * Get the user's first name. * @param string $value * @return string */ public function getDateOfBirthAttribute($value) { return Carbon::parse($value)->format('m/d/Y'); }
} `