Calculate difference between two dates using Carbon and Blade

前端 未结 4 1717
执念已碎
执念已碎 2020-11-27 20:44

Does anyone know how to pass a given variable instead the Carbon\'s default parameters ?

The documentation of Carbon says:

// CARBON SAMPLE

$dtToron         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 21:08

    Shortest way

    We can directly write it in blade

    {{ \Carbon\Carbon::parse( $start_date )->diffInDays( $end_date ) }}
    

提交回复
热议问题