Last active
June 12, 2020 12:10
-
-
Save ajay-ag/1124a7631629a6225f635d632b167a9e to your computer and use it in GitHub Desktop.
Date Format Helpler Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!function_exists('dateformat')){ | |
function dateformat($date , $format=null ) { | |
$setting = Cache::remember('default_setting',600 ,function () { | |
return \DB::table('settings')->first(); | |
}); | |
$date = Carbon::parse($date)->format($format??$setting->date_format); | |
return $date; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment