How to set .active with laravel in css?

Posted 1 month ago by irankhosravi

I tried to show slideshow for first image be show.


public function index()
    $slideshows = Slideshow::latest()->get();
    $services = Service::latest()->get();
    $faqs = Faq::latest()->get();
    return view('Home.index', compact('slideshows', 'services', 'faqs'));


<div id="home" class="pt-5">
    <div class="bd-example">
        <div id="carouselSlider" class="carousel slide" data-ride="carousel">
            <ol class="carousel-indicators">
                @foreach($slideshows as $slideshow)
                    <li data-target="#carouselSlider" data-slide-to="{{ $slideshow->id }}" class="active"></li>
            <div class="carousel-inner">
                @foreach($slideshows as $slideshow)
                    <div class="carousel-item active">
                        <img src="images/slideshows/{{ $slideshow->image }}" class="d-block w-100">
                        <div class="carousel-caption d-none d-md-block">
                            <h5>{{ $slideshow->title }}</h5>
                            <p>{!! str_limit($slideshow->body, 50) !!}</p>
            <a class="carousel-control-prev" href="#carouselSlider" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            <a class="carousel-control-next" href="#carouselSlider" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only">Next</span>

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

Reply to

Use Markdown with GitHub-flavored code blocks.