Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get age with carbon in laravel

use CarbonCarbon; // 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");
Comment

PREVIOUS NEXT
Code Example
Php :: wordpress wp_query orderby random 
Php :: specified key was too long; max key length is 767 bytes (s 
Php :: inrandomorder laravel 
Php :: serve php file 
Php :: create laravel project specific version 
Php :: phpexcel set font color 
Php :: PHP Warning: require(/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/api-fase/bootstrap/autoload.php on line 17 
Php :: index.php wordpress 
Php :: php string replace 
Php :: laravel request all delete _token 
Php :: last insert id model codeigniter 
Php :: wp_query count result 
Php :: disable wordpress admin bar 
Php :: hit a simple url using curl in php 
Php :: wordpress disallow_file_edit 
Php :: php content type xml 
Php :: url encode php 
Php :: php array in cookie 
Php :: set nav link active on the basis of route laravel 
Php :: laravel https assets 
Php :: Unresolvable dependency resolving [Parameter #0 
Php :: php mysql count rows 
Php :: hide wordpress errors 
Php :: codeigniter get where 
Php :: php max_execution_time 
Php :: for loop php 
Php :: laravel convert datetime to date 
Php :: wp php related post by category 
Php :: php echo alert js 
Php :: parsefloat php 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =