LaravelCollective / docs

Documentation for LaravelCollective Packages
158 stars 103 forks source link

Example code's comments are wrong #25

Closed l1hx closed 8 years ago

l1hx commented 8 years ago

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'); }

/**
 * 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');
}

} `