dimanche 27 octobre 2019

Why am I getting a carbon instance from a collection?

I have this collection of riv_queries.

$riv_queries = RivQuery::where('id', Auth::user()->id)->first();
RivQuery {#157 ▼

#attributes: array:12 [▼
    "id" => 88
    "riv_from" => "2019-10-15"
    "riv_to" => "2019-10-15"
    "department_id" => 109
    "type_id" => 0
    "record_type_id" => 1
    "cal_year" => 2018
    "accordion" => 0
    "city_id" => 0
    "region_id" => 8
    "prov_id" => 837
    "tx_date" => "2019-10-15"
  ]

My problem is whenever I want to get 'riv_to' or 'riv_from' I always get this as a result

dd($riv_queries->riv_to);
Carbon @1571068800 {#638 ▼
  date: 2019-10-15 00:00:00.0 Asia/Manila (+08:00)
}

But i only expect result like this

"2019-10-15"

What am I doing wrong?



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

Aucun commentaire:

Enregistrer un commentaire