Title of the topic is clearly not relevant to the question, because I lack the erudition to formulate the question, but the essence is as follows:
There is a table of cities, when receiving the collection, sorting alphabetically is used, sortBy ('name') , when outputting via @foreach () you need to get the first letter of sorted cities. For example:
Is there a way in Laravel to do this? Or do you need to write a filter with pens?
