need to get next Task after the one in the URL

Posted 2 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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.