Fajar
167
10
Laravel

somthing worng

Posted 3 weeks ago by Fajar

Hay i get code into view my blade is there to help

index.blade.php

<section class="jumbotron text-center">
    <div class="container">
        <h1 class="jumbotron-heading">
            {{ $series->title }}
        </h1>
        <p class="lead text-muted">{{ $series->title }}</p>
        @auth
            @hasStartedSeries($series)
                <h2 class="font-weight-bold text-muted">
                    {{round($user->getPerCompleteSeries($series))}}
                    % Completed
                </h2>
                <div class="mb-4">
                    <a href="{{ route('series.learning', $series->slug) }}" class="btn btn-outline-info mr-3" >
                        Continue Learning
                    </a>
                    @else
                    <a href="{{ route('series.learning', $series->slug) }}" class="btn btn-outline-info">
                        Start Learning
                    </a>
                </div>
            @endhasStartedSeries
        @endauth
    </div>
</section>

I am calling hasstartedseries from trait

Learning.php

public function hasStartedSeries($series){
        return $this->getNumCompleteLessonInSeries($series) > 0;
}

And i get results like this in my blade

@hasStartedSeries($series) 0 % Completed

Continue Learning -> button

can you help me

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