if smiliar foreach then add together Laravel 5.2

21
July 12, 2018, at 00:50 AM

i want to add the values if they were same and similar

like this :

AAA     122
AAA     111
AAA     225
AAA     222
AAA     115
AAA     12
AAA     2
AAA     123
AAA     222
BBB     12

here i want add all of 'AAA' values and just show one of them

this is my view:

@foreach($WhoSales as $WhoSales)
    <tr>
        <td>{{ $WhoSales->user->name }}</td>
        <td>{{ $WhoSales->quantity }}</td>
    </tr>
@endforeach

and my controller:

$WhoSales = SalesReport::where('department_id', Auth::user()->department_id)->get();
READ ALSO
which is faster? echo &ldquo;&rdquo; or close php for printign HTML

which is faster? echo “” or close php for printign HTML

in my wordpress special Theme functionphp file i have alot of functions that contain some Html inside php codes

44
Not beautiful json array PHP [duplicate]

Not beautiful json array PHP [duplicate]

This question already has an answer here:

42
New template on External file - VueJS

New template on External file - VueJS

I am giving my first steps into SPA and VueJS and im trying to develop an small application which has many templates on the same and 1 on an external fileI was trying to follow the same logic for the same file's templates, but i have just seen that it is a complete...

49