Skip to content
Advertisement

How to group some data on basis of two fields in Laravel?

Here I’m trying to keep track of my Employees Skills like when they are added, when removed and then new skills are added.

So, I’m getting storing them in the database as follows:

Skills History Table

Then Retrieving the data as follows:

JavaScript

And then showing them in the blade as:

JavaScript

So as expected in the browser it shown like this:

enter image description here

But I want to group all the added skills on a date and all the removed skills on a date in an individual group. And I want to order the list on basis of date.

Kind of as follows(This is static):

enter image description here

How can I Achieve that? Thanks!

Advertisement

Answer

You can try this:

JavaScript

Result:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement