Call to a member function diff() on null - Count days between dates [closed]

i need to create a counter between dates

Controller:

$registro = Registro::where('fechaviso', $request->id)->first();
$fechaaviso = $registro->fechaviso;
$fechahoy = new DateTime();
$contadorfecha = $fechaaviso->diff($fechahoy);

I need to count the days that pass between the date of the variable: $fechaviso, to today.

error:

Call to a member function diff() on null

help pls



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3zlNrEa
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

BlueHost Web Hosting Review: Secrets Revealed for Shared Hosting

How to Create Treeview with Bootstrap and jQuery

Submit Form using jQuery AJAX and PHP without Page Refresh