so i have a blade helper:
Blade::directive('date', function ($expression) {
return "<?php echo ($expression)->format('D d, M'); ?>";
});
and normally when i echo out a model's date like so: @date($model->start_time)
works nicely..
but i am doing a foreach (on invoices grouped by date paid) so i get a collection which has a date (or null) with another collection as 'values'.. so i am doing:
@forelse($invoiceGroup as $date => $invoices)
@date($date)
@foreach($invoices as $invoice)
@date($date) is giving me problems and not working.. it doesnt pass in the actual value of $date to the @date() function and so i get an error cannot format a string '$date'..
i have dumped($expression) and indeed it is = to literal 'date' and not whatever the date is..
(for now i have created a php helper which does the same thing but kind of annoying..)