Category : count

I need to add two numbers/amount displayed in my blade view, as shown in the image below I need to display as 666.68 / 1000 AUD Here’s my blade codes <td> @foreach ($team->competitionPayments as $payment) {{ $payment->amount }} @endforeach <br> {{ $team->competitionPayments }} / @foreach ($team->competitions as $total) {{ $total->pivot->total_fee .’ AUD’}} @endforeach </td> Here’s ..

Read more

Here above I want to Calculate Buying Total and selling Total in the current month . Suppose in November I want to calculate sell row total , buying row total and buying-selling total count. How Can I do that . Please help… **<table id="datatable" class="table table-striped table-bordered"> <thead> <tr> <th>Date</th> <th>Product Name</th> <th>Quantity (Stock IN)</th> ..

Read more

I’m working on laravel have having trouble to get the count of how many people the users have sponsored the table is called users and the data looks like below. |————–|—————- |————-| | id | first_name | sponsor_id | |————–|——————|————-| | 59 | kaqefizew | NULL | |————–|——————|————-| | 68 | fucifaxe | 59 | ..

Read more

i am using paginator in foreach blade and i want to total data where status is not complete or complete in all pages, currently when im using $data->total() outside foreach it works, but when im using $data->where(‘status’, ‘=’, 1)->total() it returns error Method IlluminateDatabaseEloquentCollection::total does not exist. and when im using count() method it works ..

Read more

I have a small lms app with a few models and controllers as Ecourse, Lesson and Lecture. Each Ecourse can have many Lessons and each Lesson can have many Lectures. If I want to know how many lectures an ecourse has I can do it with {{ $ecourse->lessons->count() }} and it works fine. Same with ..

Read more

I’m trying to create a chart using Chart.js, however, there is a problem when trying to count values from an array. There is a key in array called reference with values of Facebook, Google, Invitation, [Other than all that]. array_count_values(array_filter(array_column(($participants->toArray()), ‘reference’)))[‘Facebook’] ?? ‘0’; array_count_values(array_filter(array_column(($participants->toArray()), ‘reference’)))[‘Google’] ?? ‘0’; array_count_values(array_filter(array_column(($participants->toArray()), ‘reference’)))[‘Invitation’] ?? ‘0’; array_count_values(array_filter(array_column(($participants->toArray()), ‘reference’)))[‘Other’] ?? ‘0’; ..

Read more