Skip to content

Commit df6dd23

Browse files
committed
disabled_at should be deleted_at
1 parent 8d0f903 commit df6dd23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

eloquent-mutators.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,22 +97,22 @@ You may customize which fields are automatically mutated, and even completely di
9797
*
9898
* @var array
9999
*/
100-
protected $dates = ['created_at', 'updated_at', 'disabled_at'];
100+
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
101101
}
102102

103103
When a column is considered a date, you may set its value to a UNIX timestamp, date string (`Y-m-d`), date-time string, and of course a `DateTime` / `Carbon` instance, and the date's value will automatically be correctly stored in your database:
104104

105105
$user = App\User::find(1);
106106

107-
$user->disabled_at = Carbon::now();
107+
$user->deleted_at = Carbon::now();
108108

109109
$user->save();
110110

111111
As noted above, when retrieving attributes that are listed in your `$dates` property, they will automatically be cast to [Carbon](https://github.com/briannesbitt/Carbon) instances, allowing you to use any of Carbon's methods on your attributes:
112112

113113
$user = App\User::find(1);
114114

115-
return $user->disabled_at->getTimestamp();
115+
return $user->deleted_at->getTimestamp();
116116

117117
By default, timestamps are formatted as `'Y-m-d H:i:s'`. If you need to customize the timestamp format, set the `$dateFormat` property on your model. This property determines how date attributes are stored in the database, as well as their format when the model is serialized to an array or JSON:
118118

0 commit comments

Comments
 (0)