我需要在$level_task->task_name==$task->task_name
之后获取数组中的下一个值,以便为下一个任务建立链接
@foreach ($tasks as $level_task)
@if ($level_task->task_name==$task->task_name)
<a href="{{route('task', ['category' =>$level_task->path->category->slug,'level'=>$level_task->task_level,'path'=>$level_task->path->slug,'slug' => $level_task->slug])}}" class="list-group-item list-group-item-action {{$level_task->task_name==$task->task_name ? "active":""}}">{{$level_task->task_name}}</a>
@elseif ($level_task->task_name!=$task->task_name)
<a href="{{route('task', ['category' =>$level_task->path->category->slug,'level'=>$level_task->task_level,'path'=>$level_task->path->slug,'slug' => $level_task->slug])}}" class="list-group-item list-group-item-action {{$level_task->task_name==$task->task_name ? "active":""}}">{{$level_task->task_name}}</a>
@endif
@endforeach