#database #development #eloquent #laravel #php
The model class has a method called
freshTimestamp. It will return a new Carbon timestamp with the current date and
time. The same method is used for setting the
updated_at fields inside your model. You can use this
method inside your own code if you wish.
1$book = new Book(); 2$book->title = 'The world of Pringles'; 3$book->published_at = $book->freshTimestamp();
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.