Skip to main content

Get Transactions: Resource with Money/Date Transformation

Premium
6:28

The Full Lesson is Only for Premium Members

Want to access all of our courses? (30 h 09 min)

You also get:

55 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

RA
Richard A. Hoyle ✓ Link copied!

With Laravel 10 the ->format('m/d/Y'), will not work. I am getting a error, however when I remove it postman works with no error Not shour why this is happing.

"message": "Call to a member function format() on string",
"exception": "Error",
"file": "C:\\xampp\\htdocs\\lvdy\\project1\\app\\Http\\Resources\\TransactionResource.php",
"line": 22,
PK
Povilas Korop ✓ Link copied!

Yes, Laravel deprecated the $dates in favor of $casts: https://laraveldaily.com/post/laravel-datetime-to-carbon-dates-casts

Unfortunately I can't reshoot the course/video for it, partially why I decided to write text-form courses more, to be easier to edit in the future.

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.