Does anyone know how to pass a given variable instead the Carbon's default parameters ?
The documentation of Carbon says:
// CARBON SAMPLE
$dtToronto = Carbon::createFromDate(2012, 1, 1, 'America/Toronto');
$dtVancouver = Carbon::createFromDate(2012, 1, 1, 'America/Vancouver');
echo $dtVancouver->diffInHours($dtToronto); // 3
And i want to do something like this in my controller:
// EXAMPLE
$date = "2016-09-16 11:00:00";
$datework = Carbon::createFromDate($date);
$now = Carbon::now();
$testdate = $datework->diffInDays($now);
And retrieving that on a Blade template
// VIEW ON BLADE
<td> {{ $testdate }} </td>