need to get next Task after the one in the URL

Posted 7 months ago by Kareimovich

this for each gave me task where task slug is the same as URL now I need to get the first task after this one so I make redirect link later

@foreach ($Tasks as $Task)
 @if (  $Task->slug == Request::segment(5) )
            <h2> {{ $Task->task_name }} </h2>
  @endif
@endforeach

I need to get the task how is after the one in URL from foreach

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.