mercredi 1 juin 2016

Can't use Carbon Laravel method in my laravel .blade view

In my Controller I get the current date an another date, I send this params to my view.blade:

$current_date = Carbon::now('Europe/Madrid');
$second_date  = Carbon::create(2016, 6, 3, 00, 00, 00, 'Europe/Madrid');

In my Controller this function works fine:

$current_date->lt($second_date) # true

But in my blade.php Laravel report this error: FatalErrorException in efcb37f79f0e8cb86e0f747997c402d6f7026ada.php line 112: Call to a member function lt() on string

I debug my laravel view and the lt() method receives a correct Carbon object

Carbon {#361 ▼
  +"date": "2016-06-03 00:00:00.000000"
  +"timezone_type": 3
  +"timezone": "Europe/Madrid"
}

what is happening here?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire