@bobbybouwmann @nfauchelle
sorry, I still am a bit foggy. I have set the protected $dates as per jeffrey's video, like this to include my "approval_date".
protected $dates = ['approval_date','created_at', 'updated_at', 'deleted_at' ];
Then my controller requests my model to pull a whole row of data from the DB.
$date = (Carbon::now()->subDays(30));
$contractor_invoices = $this->invoice->find_historical_invoices($this->id,$date);
Model:
public function find_historical_invoices($id,$date )
{
return DB::table('contractor_invoices')
->where('contractor_id','=', $id)
->where('approval_date','<',$date)
->where('status','=','approved')
->select('*')
->orderBy('approval_date', 'asc')
->get();
}
Now, In my View, I have passed the result from the DB query in a variable : {{$contractor_invoices}} which I run a foreach loop on to get all the separate invoices and their dates. So, I end up with {{invoices->approval_date}}
So, I need to format this into Month / Day/ Year.
How do I do this, what have I missed. I did look at the docs you mentioned, but it did not jump out at me.
Many thanks !