Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Illuminate\Support\Carbon instead of Carbon\Carbon #600

Merged
merged 3 commits into from
May 7, 2018

Conversation

mgrinspan
Copy link
Contributor

@mgrinspan mgrinspan commented Dec 27, 2017

Laravel has a wrapper class for Carbon that it uses for model attributes in the $dates array and the created_at and updated_at attributes. This pull request changes all model docblocks to use the wrapper class instead of the base class.

@svenluijten
Copy link

Any update on this? 🙂 This was included in Laravel since laravel/framework#19771, would be useful to have in ide-helper as well 😄

@barryvdh barryvdh merged commit 94248ad into barryvdh:master May 7, 2018
@mrextreme
Copy link

mrextreme commented Apr 9, 2020

It still mixes \Illuminate\Support\Carbon and Carbon\Carbon when generating phpdoc blocks for models. Laravel 5.x, 6.x, 7.x, ide helper 2.6.7

 * @property \Illuminate\Support\Carbon|null $start
 * @property \Carbon|null $stop
 * @property \Carbon|null $contract_ends
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at

all these fields are in the protected $dates array

@mfn
Copy link
Collaborator

mfn commented Apr 9, 2020

mixes \Illuminate\Support\Carbon and Carbon\Carbon

But your example only has \Carbon? that seems totally off… ?

@mrextreme
Copy link

mrextreme commented Apr 10, 2020

I copy-pasted that from the actual code, while typed in the text above it from head memory. Just deleted that phpdoc block and ran ide-helper:models again, and the output is different again. \Carbon doesn't even exists, it should be \Carbon\Carbon. Just searched the source code at ...myPathTpProject/vendor/barryvdh/laravel-ide-helper, and everywhere i see \Illuminate\Support\Carbon, yet the output randomly produces \Carbon for some fields. Both start and stop are DATE fields ( date nullable default null ), yet they end up having different classes.

 * @property \Illuminate\Support\Carbon|null $start
 * @property \Carbon\Carbon|null $stop
 * @property \Carbon|null $contract_ends

@svenluijten
Copy link

This discussion doesn't seem to be related to this issue? Maybe create a new issue so it can be tracked better? :)

@mrextreme
Copy link

ok, sure

cgxxv pushed a commit to cgxxv/laravel-ide-helper that referenced this pull request Mar 25, 2022
Use Illuminate\Support\Carbon instead of Carbon\Carbon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants