Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel 8 blade get days and hours ago

@php($diffInDays = CarbonCarbon::parse($user->created_at)->diffInDays())

@php($showDiff = CarbonCarbon::parse($user->created_at)->diffForHumans())

@if($diffInDays > 0)

@php($showDiff .= ', '.CarbonCarbon::parse($user->created_at)->addDays($diffInDays)->diffInHours().' Hours')

@endif

{{$showDiff}}
Comment

PREVIOUS NEXT
Code Example
Php :: drupal 8 get enabled languages 
Php :: laravel add user 
Php :: woocommerce change add to cart message 
Php :: php foreach alternative syntax 
Php :: drop column migration laravel 
Php :: http_response_code 
Php :: laravel module make migration 
Php :: add execute time php 
Php :: laravel-cors 
Php :: php print to console 
Php :: laravel add column to table 
Php :: New Laravel Devcontainer Project Setup 
Php :: create controller with model resources and request command in laravel 
Php :: symfony set timezone 
Php :: input file accept jpg jpeg png php 
Php :: read line by line php 
Php :: PHP str_split — Convert a string to an array 
Php :: laravel target is not instantiable while building 
Php :: php convert guzzle response to json 
Php :: wpdb get last query 
Php :: lDownload multiple files as a zip-file using php 
Php :: laravel append parameter to links 
Php :: codeigniter installation with composer 
Php :: How to create and access angular HTTP params in PHP 
Php :: php number to words 
Php :: laravel make model along with its controller and migration file 
Php :: how create migration in laravel 
Php :: how to make arrays in php 
Php :: phpmyadmin 403 forbidden centos 6 
Php :: generate random string in php 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =