Skip to content

Commit

Permalink
fix: convert remaining dates to casts
Browse files Browse the repository at this point in the history
  • Loading branch information
itinerare committed Feb 18, 2024
1 parent 824bd29 commit fd8d61a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/Models/Raffle/RaffleTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ class RaffleTicket extends Model {
protected $table = 'raffle_tickets';

/**
* Dates on the model to convert to Carbon instances.
* The attributes that should be cast to native types.
*
* @var array
*/
protected $dates = ['created_at'];
protected $casts = [
'created_at' => 'datetime',
];

/**
* Validation rules for creation.
*
Expand Down
7 changes: 5 additions & 2 deletions app/Models/User/UserSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ class UserSettings extends Model {
protected $table = 'user_settings';

/**
* Dates on the model to convert to Carbon instances.
* The attributes that should be cast to native types.
*
* @var array
*/
protected $dates = ['banned_at', 'deactivated_at'];
protected $casts = [
'banned_at' => 'datetime',
'deactivated_at' => 'datetime',
];

/**
* The primary key of the model.
Expand Down

0 comments on commit fd8d61a

Please sign in to comment.