Skip to content

Commit

Permalink
Merge pull request alexeymezenin#166 from datlechin/master
Browse files Browse the repository at this point in the history
`$dates` property is deprecated, use `$casts` instead
  • Loading branch information
spekulatius authored May 15, 2023
2 parents 76138e1 + 0f7cdb6 commit 548fa70
Show file tree
Hide file tree
Showing 18 changed files with 67 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ Good:

```php
// Model
protected $dates = [
'ordered_at',
protected $casts = [
'ordered_at' => 'datetime',
];

// Blade view
Expand Down
5 changes: 4 additions & 1 deletion arabic.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,10 @@ $apiKey = config('api.key');

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion bangla.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,10 @@ $apiKey = config('api.key');

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion chinese.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,10 @@ $apiKey = config('api.key');

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion french.md
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@ Bien:

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
4 changes: 2 additions & 2 deletions german.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ Gut:

```php
// Model
protected $dates = [
'ordered_at',
protected $casts = [
'ordered_at' => 'datetime',
];

// Blade view
Expand Down
5 changes: 4 additions & 1 deletion indonesia.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@ Contoh terbaik:

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion italian.md
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@ Giusto:

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion japanese.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,10 @@ Good:

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion persian.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,10 @@ $apiKey = config('api.key');

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion polish.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,10 @@ Dobrze:

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
4 changes: 3 additions & 1 deletion russian.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,9 @@ $apiKey = config('api.key');

```php
// Модель
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];
// Читатель (accessor)
public function getSomeDateAttribute($date)
{
Expand Down
5 changes: 4 additions & 1 deletion spanish.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,10 @@ Bueno:

```php
// Modelo
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion thai.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,10 @@ $apiKey = config('api.key');

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion traditional-chinese.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@ Good:

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion turkish.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,10 @@ Kötü:

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion ukrainian.md
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ $apiKey = config('api.key');

```php
// Модель
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down
5 changes: 4 additions & 1 deletion urdu.md
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ $apiKey = config('api.key');

```php
// Model
protected $dates = ['ordered_at', 'created_at', 'updated_at'];
protected $casts = [
'ordered_at' => 'datetime',
];

public function getSomeDateAttribute($date)
{
return $date->format('m-d');
Expand Down

0 comments on commit 548fa70

Please sign in to comment.