Skip to content
Advertisement

Separation the table and each name follows the table

I want Make Different on Table, Each table has a service name Dontt Need Loop Again Table same Group Name, Each group has the name of the service

Check : https://i.ibb.co/NTnynGq/639.png


View : Package.blade.php

JavaScript

Package Model

JavaScript

PackageController.php

JavaScript

Want Separation each group has the name of the service

Advertisement

Answer

Option 1: You can add an ORDER BY group_id in the query

JavaScript

Option 2: You can sort by the group name in the foreach

JavaScript

or

JavaScript

Option 3: Use the Collection‘s groupBy method.

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