diff --git a/src/Coders/Model/Model.php b/src/Coders/Model/Model.php index e9d2d0a2..cedc8344 100644 --- a/src/Coders/Model/Model.php +++ b/src/Coders/Model/Model.php @@ -352,7 +352,7 @@ public function phpTypeHint($castType, $nullable) case 'collection': $type = '\Illuminate\Support\Collection'; break; - case 'date': + case 'datetime': $type = '\Carbon\Carbon'; break; case 'binary': @@ -994,7 +994,7 @@ public function getDates() { return array_diff( array_filter($this->casts, function (string $cast) { - return $cast === 'date'; + return $cast === 'datetime'; }), [$this->CREATED_AT, $this->UPDATED_AT] ); diff --git a/src/Meta/MySql/Column.php b/src/Meta/MySql/Column.php index 852942e0..e90ba717 100644 --- a/src/Meta/MySql/Column.php +++ b/src/Meta/MySql/Column.php @@ -30,7 +30,7 @@ class Column implements \Reliese\Meta\Column */ public static $mappings = [ 'string' => ['varchar', 'text', 'string', 'char', 'enum', 'set', 'tinytext', 'mediumtext', 'longtext', 'longblob', 'mediumblob', 'tinyblob', 'blob'], - 'date' => ['datetime', 'year', 'date', 'time', 'timestamp'], + 'datetime' => ['datetime', 'year', 'date', 'time', 'timestamp'], 'int' => ['bigint', 'int', 'integer', 'tinyint', 'smallint', 'mediumint'], 'float' => ['float', 'decimal', 'numeric', 'dec', 'fixed', 'double', 'real', 'double precision'], 'boolean' => ['bit'] diff --git a/src/Meta/Postgres/Column.php b/src/Meta/Postgres/Column.php index 8dad56fc..0564fcdc 100644 --- a/src/Meta/Postgres/Column.php +++ b/src/Meta/Postgres/Column.php @@ -29,7 +29,7 @@ class Column implements \Reliese\Meta\Column */ public static $mappings = [ 'string' => ['character varying', 'varchar', 'text', 'string', 'char', 'character','enum', 'tinytext', 'mediumtext', 'longtext', 'json'], - 'date' => ['timestamp with time zone', 'timestamp without time zone', 'timestamptz', 'datetime', 'year', 'date', 'time', 'timestamp'], + 'datetime' => ['timestamp with time zone', 'timestamp without time zone', 'timestamptz', 'datetime', 'year', 'date', 'time', 'timestamp'], 'int' => ['int', 'integer', 'tinyint', 'smallint', 'mediumint', 'bigint', 'bigserial', 'serial', 'smallserial', 'tinyserial', 'serial4', 'serial8'], 'float' => ['float', 'decimal', 'numeric', 'dec', 'fixed', 'double', 'real', 'double precision'], 'boolean' => ['boolean', 'bool', 'bit'], diff --git a/src/Meta/Sqlite/Column.php b/src/Meta/Sqlite/Column.php index b7a263ab..068d4ab7 100644 --- a/src/Meta/Sqlite/Column.php +++ b/src/Meta/Sqlite/Column.php @@ -28,7 +28,7 @@ class Column implements \Reliese\Meta\Column */ public static $mappings = [ 'string' => ['varchar', 'text', 'string', 'char', 'enum', 'tinytext', 'mediumtext', 'longtext'], - 'date' => ['datetime', 'year', 'date', 'time', 'timestamp'], + 'datetime' => ['datetime', 'year', 'date', 'time', 'timestamp'], 'int' => ['bigint', 'int', 'integer', 'tinyint', 'smallint', 'mediumint'], 'float' => ['float', 'decimal', 'numeric', 'dec', 'fixed', 'double', 'real', 'double precision'], 'boolean' => ['longblob', 'blob', 'bit'],