Level 53
@foreach ($anime->episode->reverse() as $episode)
That should reverse your collection of episodes within this anime show.
I want to reverse the Episode order of each Anime post. Also apply pagination to it. Please Help.
public function index()
{
$animes = Anime::paginate(2);
return view('welcome',compact('animes'));
}
public function view(anime $anime) { return view('show', compact('anime'));
}
@extends ('layouts.animes')
@section ('content')
<section class="jumbotron text-center">
<div class="container">
<h1 class="jumbotron-heading">{{ $anime->anime_name}}</h1>
<img class="img-top" src="{{ Storage::url($anime->anime_img) }}" alt="Anime_image">
<p class="lead ">{{$anime->anime_story}}</p>
<p>
<a href="/avatars/create" class="btn btn-primary my-2">Make New One</a>
</p>
</div>
</section>
@foreach ($anime->episode as $episode)
@endforeach
</main>
@foreach ($anime->episode->reverse() as $episode)
That should reverse your collection of episodes within this anime show.
Please or to participate in this conversation.