Answers for "how to where dob as age in laravel"

PHP
1

how to calculate age in laravel

use Carbon\Carbon; // Include Class in COntroller

$request->date_of_birth = "2000-10-25";
$age = Carbon::parse($request->date_of_birth)->diff(Carbon::now())->y;

dd($age. " Years"); // To check result
Posted by: Guest on March-21-2021

Code answers related to "how to where dob as age in laravel"

Browse Popular Code Answers by Language