Hi Aj,
Please look at the documentation carefully, they actually have example in the doc using what you're after. Also, i am sorry to say this but, the code above you're trying is syntactically incorrect, please refer to PHP OOP Documentation to brush your PHP OO skills.
**here is what you're trying to accomplish **
Date::createFromDate($article->date)->format('l j F Y H:i:s')
Thanks.
Thanks a lot this works. When I translate this is this correct?
Date:: - class createFromDate - object $article->date - property format() - method
Sorry for the newbie questions... im still figuring out OOP.
Hi Aj,
You're most welcome, and there is no problem at all in asking newbie question, we are all been there at one point, and i can tell you from experience the best thing to do when learning this stuff is to get down in the code and make mistakes and to not be afraid to seek help (ask question).
Mostly correct but createFromDate()* is a method not an object. Here are part of the code.
Date is the class
createFromDate() is a method of a Date class
$article is an object you're passing to createFromDate() method
date is a property of $article object
format() is a method of Date class
I hope this is what you've asked and it's a helpful to you.
Thanks.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community