Controller :
$args = array();
$args['name'] = "Robin";
$args['email'] = "asdasd@asdasd.net";
$clientpayments = Payments::getPaymentByClient($id);
$args['activity'] = $clientpayments;
return view('clients.show',["args" => $args]);
View:
{{ $args->name }}
{{ $args->email }}
@if (isset($args['activity']))
@foreach ($args['activity'] as $act)
{{$act->job_name}}
@endforeach
@endif;
So what the issue is is that $activity loop works fine but the $name and $email is returning a non-object error... Any ideas to where I'm going wrong?
Thanks!