I have a Laravel (5.2) Eloquent Model where the database field type is MySQL Timestamp and having values in Y-m-d H:i:s format,
I am wiring some Laravel Eloquent model as:
UserSubscription::where('renewal_date','<=',Carbon::now());
but when I print this using toSql() , the query print ? instead Carbon::now() value, I also tried below options by replacing Carbon::now() with:
-
Carbon::now('UTC') I already have timezone defined in my config file as UTC.
-
Carbon::now()->format('Y-m-d H:i:s')
-
Carbon::now()->toDateTimeString()
-
date('Y-m-d H:i:s')
but nothing worked, where and what I am doing wrong..?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire