Newest content
-
· 10 mins, 1828 words
Your First App in Flutter: Default One VS Understandable One
-
· 1 min, 163 words
FREE E-book: 100 Laravel Quick Tips (and counting)
-
Random Quick Laravel Tip:
Change Format Of Created_at and Updated_atTip given by @syofyanzuhad
To change the format of
created_at
you can add a method in your model like this:1public function getCreatedAtFormattedAttribute()2{3 return $this->created_at->format('H:i d, M Y');4}So you can use it
$entry->created_at_formatted
when it's needed. It will return thecreated_at
attribute like this:04:19 23, Aug 2020
.And also for changing format of
updated_at
attribute, you can add this method :1public function getUpdatedAtFormattedAttribute()2{3 return $this->updated_at->format('H:i d, M Y');4}So you can use it
$entry->updated_at_formatted
when it's needed. It will return theupdated_at
attribute like this:04:19 23, Aug 2020
. -
· Updated Aug 2022 · 4 mins, 735 words
8 Tricks with Laravel Timestamps
-
· 2 mins, 286 words
Taylor Otwell: Laravel 7 Will Move Auth Controllers into UI Package
-
· 3 mins, 504 words
Upload and Parse CSV with Laravel MediaLibrary and SpreadsheetReader
-
Premium Course: Laravel Collections Chains: 15 Real Examples
-
· Updated Aug 2022 · 3 mins, 454 words
Eloquent: Recursive hasMany Relationship with Unlimited Subcategories
-
· 4 mins, 607 words
The Biggest Problem with Eloquent Accessors "Magic"
-
· Updated Aug 2022 · 2 mins, 253 words
Get Array of IDs from Eloquent Collection: pluck() or modelKeys()
-
· 2 mins, 352 words
Laravel: Get Newest/Oldest Records from Pivot Table in BelongsToMany
-
· 6 mins, 1134 words
Laravel Two-Step Registration: Optional Fields for Country and Bio