Have you tried passing $alerts seperately with a ->with.
(other stuff being passed)->with('data2',$alerts);
hi jimgwhit, thanks for the reply.. yes i tried that too it works. the problem is that when you send the email alerts the data in the array is not there. passing it's elements as a variable they are visible but as an array it just doesn't work. the foreach loop in the email template just echoes a blank space!
Try iterating through array first and put the data in a string format like:
$mydata1 | $mydata2 | $mydata3
using pipe as seperator:
Then use the explode function in php to place the data.
http://us.php.net/manual/en/function.explode.php
Another is split, but it's deprecated, but will still be around a while.
jimgwhit said:
Have you tried passing $alerts seperately with a ->with.
(other stuff being passed)->with('data2',$alerts); ~~~>**jimgwhit** said: Try iterating through array first and put the data in a string format like:
$mydata1 | $mydata2 | $mydata3
using pipe as seperator: Then use the explode function in php to place the data. http://us.php.net/manual/en/function.explode.php Another is split, but it's deprecated, but will still be around a while.
that works neat trick imploding and exploding the array...
thanks much
dtmuturi said:
that works neat trick imploding and exploding the array...
thanks much>dtmuturi said:
this should be the answer marked the wrong one
also found out changing the array element keys from objects to old school boxy braces works like so
<?php
if(count(($alerts))
{
Hi your accounts expire on
foreach(($alerts as $key)
{
echo '<li> #' . $key['due_date'] . 'outstanding balance is '. $key['amount'] . ' </li>';
}
}
else
{
echo 'no alerts';
}
?>
instead of
@if(count($alerts))
Hi your accounts expire on
@foreach ($alerts as $key)
{{ $key->due_date }} outstanding balance is {{ $key->amount }}
@endforeach
@else
<p>No alerts</p>
@endif
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community