Level 88
Maybe this library can help: https://github.com/morilog/jalali
Otherwise the https://github.com/jenssegers/date should be useful!
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Only converts a year to English Do not turn day and month
public function store(Request $request){
request()->validate([
'matn' => 'required',
'datex' => 'required'
]);
$arabic = ['٩', '٨', '٧', '٦', '٥', '٤', '٣', '٢', '١','٠'];
$num = range(0, 9);
$convert = str_replace($persian, $num, $request->datex);
list($year, $month, $day) = explode('-', $convert);
$user=Post::create([
'menu_id'=> $request->name,
'user_id'=>auth()->user()->id,
'body'=>$request->matn,
'Expiration_date' =>Verta::getGregorian($year, $month, $day)
]);
Please or to participate in this conversation.