sort a Laravel collection on the behalf of four conditions

Viewed 153

i have a comanies table like this in mysql.it has 3 columns. is_verified,is_platinum,platinum_start_date, end_date. table collumns

on the frontend, the data is showing in paginate format so that now I want to get the companies list sorted in only one variable. just to show companies first verified then non verified then platinum etc

  1. All Platinium and verified companies
  2. All Platinium
  3. All verified companies
  4. All no verified and no platinum user.

I have tried by "orderBy","Sorting" etc but by using individual variable

$companies = DeveloperCompanies::where('is_approved', '=', 1)->orderBy('created_at', 'desc')->paginate(9);

here is a table format

1 Answers
Related