Support the ongoing development of Laravel.io →
Laravel Blade
Last updated 1 year ago.
0
moderator

Hello @rizki,

The first steps are always difficult :)

The issue is from this line.

return view('admin.inputCargo',['users' => $users1],['packing' => $packing],['city' => $listCity ],['users' => $users]);

The view function suspect the data to be in the second parameter and optional in the third. The second part of the issue is that you use users name twice (the key of the array is the variable name in the blade)

You can do it on this way (I split the values on multiple lines for the readability). The array keys are the variable names in your blade.

return view('admin.inputCargo', [
    'users1' => $users1,
    'packing' => $packing,
    'city' => $listCity,
    'users' => $users
]);

Another way is to use the with function, that accept a key and value.

return view('admin.inputCargo')
    ->with('users1', $users1)
   ->with('packing', $packing)
   ->with('city', $listCity)
   ->with('users', $users);
0

Sign in to participate in this thread!

Eventy

Your banner here too?

rizki rizkyalayubi Joined 3 Sep 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.