Closed rentalhost closed 7 years ago
Eg.
class User extends Eloquent\Model { protected $casts = [ "some_property" => "int" ]; }
Requires: @property int $some_property Should accept: @property int|null $some_property Should accept: @property int|anything $some_property
@property int $some_property
@property int|null $some_property
@property int|anything $some_property
To consider:
id
$primaryKey
$keyType
_id
int
user_id
_at
Carbon\Carbon
created_at
$dates
$casts
integer
real
float
double
string
bool
boolean
object
array
json
collection
Collection
date
datetime
timestamp
Carbon
mixed
Forgotten item: should consider any $dates properties as Carbon\Carbon too.
Eg.
Requires:
@property int $some_property
Should accept:@property int|null $some_property
Should accept:@property int|anything $some_property
To consider:
id
(or other$primaryKey
) consider$keyType
property (or "int");_id
suffix considerint
(eg.user_id
);_at
suffix considerCarbon\Carbon
(eg.created_at
);$dates
properties asCarbon\Carbon
too;$casts
value;int
orinteger
considerint
;real
,float
ordouble
considerfloat
;string
considerstring
;bool
orboolean
considerbool
;object
considerobject
;array
orjson
considerarray
;collection
considerCollection
;date
,datetime
ortimestamp
considerCarbon
;mixed
;