Skip to content

Commit

Permalink
Merge pull request barryvdh#600 from mike-grinspan/patch-1
Browse files Browse the repository at this point in the history
Use Illuminate\Support\Carbon instead of Carbon\Carbon
  • Loading branch information
barryvdh authored May 7, 2018
2 parents 50ecd8b + b6f525b commit 94248ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions config/ide-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@
|
| For example, normally you would see this:
|
| * @property \Carbon\Carbon $created_at
| * @property \Carbon\Carbon $updated_at
| * @property \Illuminate\Support\Carbon $created_at
| * @property \Illuminate\Support\Carbon $updated_at
|
| With this enabled, the properties will be this:
|
| * @property \Carbon\Carbon $createdAt
| * @property \Carbon\Carbon $updatedAt
| * @property \Illuminate\Support\Carbon $createdAt
| * @property \Illuminate\Support\Carbon $updatedAt
|
| Note, it is currently an all-or-nothing option.
|
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ php artisan ide-helper:models Post
* @property integer $author_id
* @property string $title
* @property string $text
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property \Illuminate\Support\Carbon $created_at
* @property \Illuminate\Support\Carbon $updated_at
* @property-read \User $author
* @property-read \Illuminate\Database\Eloquent\Collection|\Comment[] $comments
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ protected function castPropertiesType($model)
break;
case 'date':
case 'datetime':
$realType = '\Carbon\Carbon';
$realType = '\Illuminate\Support\Carbon';
break;
case 'collection':
$realType = '\Illuminate\Support\Collection';
Expand Down Expand Up @@ -347,7 +347,7 @@ protected function getPropertiesFromTable($model)
foreach ($columns as $column) {
$name = $column->getName();
if (in_array($name, $model->getDates())) {
$type = '\Carbon\Carbon';
$type = '\Illuminate\Support\Carbon';
} else {
$type = $column->getType()->getName();
switch ($type) {
Expand Down

0 comments on commit 94248ad

Please sign in to comment.