I'm a total Laravel Blade noob and trying to do something I know how to do in JavaScript but need to do in a Blade template.
I want to loop through this object below $site->links()->orderBy('position')->get() and evaluate each $link->type and push to one of two new arrays based on the value. So...
global $navlinks = [];
global $legallinks = [];
// main loop
@foreach($site->links()->orderBy('position')->get() as $link)
// blavascript concept of what I need.
@if($link->type == 'nav') $navlinks.push($link)
@if($link->type == 'legal) $legallinks.push($link)
...
// Do something with new $navlinks and $legallinks arrays
I hope this makes sense...