Rating system on laravel issues

Viewed 31

I'm a complete newbie to laravel looking for a fix. I bought a script and I wanted to customise a review page and increase the number of ratings with stars from 1 row to 3 rows of questions.

        <div class='give-rating'>
            @for ($i = 5; $i >= 1; $i--)
                <span>
                    <input id='str{{ $i }}' name='rating' type='radio'
                        value='{{ $i }}'>
                    <label for='str{{ $i }}'><i class="las la-star fa-sm"></i></label>
                </span>
            @endfor
        </div>
        </div>
        <!-- start of my bullshit -->
        <div class="give-rating-person2">
        <!-- <div class="thumb">
        <img src="{{ getImage(imagePath()['profile']['user']['path'] . '/' . auth()->user()->image, null, true) }}"  alt="image">
        </div>-->
        <div class="content">
            <h6>Timelyness</h6>
        </div>
    
        <div class='give-rating'>
            @for ($i = 5; $i >= 1; $i--)
                <span>
                    <input id='str{{ $i }}' name='rating' type='radio'
                        value='{{ $i }}'>
                    <label for='str{{ $i }}'><i class="las la-star fa-sm"></i></label>
                </span>
            @endfor
            </div>
        </div>
        <!-- end of my bullshit -->
        <div class="mt-4">
            <textarea name="review" class="form--control" placeholder="@lang('Write review')" required>{{ old('review') }}</textarea>
            <div class="text-end">
                <button type="submit" class="btn btn--base">@lang('Submit')</button>
            </div>
        </div>
    </form>
</div>

here's what I have so far. The frontend seems okay but the review stars for all the rows all behave as one. I tried changing the id but it breaks the page. Any advice?

0 Answers
Related