Skip to content

Instantly share code, notes, and snippets.

@WganMe
Last active February 8, 2024 11:29
Show Gist options
  • Save WganMe/f7f7db67f7b83f5958302ff2704018fb to your computer and use it in GitHub Desktop.
Save WganMe/f7f7db67f7b83f5958302ff2704018fb to your computer and use it in GitHub Desktop.
Laravel time
<?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') !!}
@WganMe
Copy link
Author

WganMe commented Feb 8, 2024

composer require pharaonic/laravel-hijri
composer require nesbot/carbon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment