mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
* Adding support for casting to AsEnumCollection * Adding missing string to advanced_casts table for enum_collection * Added to snapshots and ArrayCastsWithComment * Update CHANGELOG.md * Reverted automated whitespace, strict changes * Updated test snapshots, tests passing * Whitespace revert --------- Co-authored-by: Barry vd. Heuvel <[email protected]>
32 lines
1.3 KiB
PHP
32 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AdvancedCasts\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Casts\AsArrayObject;
|
|
use Illuminate\Database\Eloquent\Casts\AsCollection;
|
|
use Illuminate\Database\Eloquent\Casts\AsEnumCollection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class AdvancedCast extends Model
|
|
{
|
|
protected $casts = [
|
|
'cast_to_date_serialization' => 'date:Y-m-d',
|
|
'cast_to_datetime_serialization' => 'datetime:Y-m-d H:i:s',
|
|
'cast_to_custom_datetime' => 'custom_datetime:Y-m-d H:i:s',
|
|
'cast_to_immutable_date' => 'immutable_date',
|
|
'cast_to_immutable_custom_datetime' => 'immutable_custom_datetime:Y-m-d H:i:s',
|
|
'cast_to_immutable_datetime' => 'immutable_datetime',
|
|
'cast_to_timestamp' => 'timestamp',
|
|
'cast_to_encrypted' => 'encrypted',
|
|
'cast_to_encrypted_array' => 'encrypted:array',
|
|
'cast_to_encrypted_collection' => 'encrypted:collection',
|
|
'cast_to_encrypted_json' => 'encrypted:json',
|
|
'cast_to_encrypted_object' => 'encrypted:object',
|
|
'cast_to_as_collection' => AsCollection::class,
|
|
'cast_to_as_enum_collection' => AsEnumCollection::class,
|
|
'cast_to_as_array_object' => AsArrayObject::class,
|
|
];
|
|
}
|