Last active
February 8, 2024 11:29
-
-
Save WganMe/f7f7db67f7b83f5958302ff2704018fb to your computer and use it in GitHub Desktop.
Laravel time
This file contains 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 | |
use Carbon\Carbon; | |
$dt = Carbon::now(); | |
// Global | |
$locale = ('app.locale'); | |
Carbon::setLocale('$locale'); | |
?> | |
{!! Theme::partial('header') !!} | |
<center> | |
@if ( Config::get('app.locale') == 'en') | |
<?php | |
echo nl2br (" \n "); | |
echo $dt->isoFormat('LLLL'); | |
echo nl2br (" \n "); | |
echo $dt->toHijri()->isoFormat('LLLL'); | |
echo nl2br (" \n "); | |
?> | |
@elseif ( Config::get('app.locale') == 'ar' ) | |
<?php | |
echo nl2br (" \n "); | |
echo $dt->locale('ar')->isoFormat('LLLL'); | |
echo nl2br (" \n "); | |
echo $dt->toHijri()->locale('ar')->isoFormat('LLLL'); | |
echo nl2br (" \n "); | |
?> | |
@endif | |
</center> | |
<div id="homepage-1"> | |
{!! Theme::content() !!} | |
</div> | |
{!! Theme::partial('footer') !!} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
composer require pharaonic/laravel-hijri
composer require nesbot/carbon