Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ralphmorris's avatar

Scope orderby subscription level - Cashier

I have 3 subscription levels with Laravel Cashier and Stripe.

Free - no customer/subscription created. Pro Member - monthly subscription Pro Plus member - monthly subscription

I have been tasked with ordering Users by subscription like so.

Pro Plus Member - Priority 1 Pro Member - Priority 2 Free - Priority 3

The only idea I have is to have an integer 'order' field on the user model and create a global scope to order by this field.

But I am wondering if there is a tidier way that I can do the calculation based on the stripe_plan itself?

Stripe Plans Ids are as above:

Pro Plus Member Pro Member Free (no stripe plan created)

Thanks in advance

Ralph

0 likes
0 replies

Please or to participate in this conversation.