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

christophrumpel's avatar

Free / Admin accounts for Spark

Hey,

so how do I make "free" accounts for e.g admin users? Now while development I use Stripe test data to let my admin account inside my application but how do I do that live? Do I need to use Stripe coupons? Or can I define that a user is sthg like an admin that do not need to pay for a subscription?

Didn't find anything about it in the Spark documentation.

Thx and greets

0 likes
23 replies
cjke7777's avatar

Does adding those admin accounts to the $developers array help, in file:

/spark/src/Configuration/ManagesAppDetails.php
christophrumpel's avatar

For what I've heard they are just for giving these users access to the Kiosk, but I will try it again. thx

zanematthew's avatar

In your app/Providers/SparkServiceProvider.php there's a protected $developers array. You can add them there. However this along the lines of "where", but with your question;

how do I make "free" accounts for e.g admin users?

You'll need to determine the best course of action for said logic for your application.

Here's one way version of "how"...add a new field to your users table say "admin" (not sure if there is an admin flag already). When users login check this entry, retrieve their email, add it to the protected $developers array and now they should have access to the admin.

ulrichm's avatar

I have the same question and I don´t think the answer is here or maybe I´m not smart enough to read the answer....

I am also going to use spark as an api for other sites, so no one is going to pay anything, and users are only created to create an api key and use the built in security.

EventFellows's avatar

Maybe you can re-phrase your question then...

But just in general:

  • subscriptions are handled with the plans and
  • developer-functionality access is handled with the $developer-array mentioned above.

Technically they are completely separated aspects that you can mix and match as you need.

christophrumpel's avatar

thx @zanematthew

the "how" you explained is way to dynamically add users to the $developers array, but does this mean adding an email to the array will give them free access? And yes how does this work? Can I put in an e-mail address of someone and when he registers then he doesn't need to select a plan? This is unclear to me.

christophrumpel's avatar

I guess I forgot to write that this is about TeamBilling. (shouldn't make big difference)

NOW:

When I register I need to the trial or pay for plan. Even If it is my application :-)

WHAT I WANT:

Entering an E-Mail address (like the given $developers array) in the code and when this person registers a new team, he doesn't have pick plan or he automatically gets an "admin-plan" or something like that.

Zile's avatar

I had exactly same questions. This whole thing about registering 'developers' is confusing, and no one at laracasts was able to explain it to me. I wasn't dealing with teams, but it's the same situation... Why would developer or administrator need to subscribe?

EventFellows's avatar

I have just tried to setup a free plan only on the spark-sample installation (you can get it from spark website) - it works without any further customizition out of the box.

Regarding your wish to already have the user's emails defined in the developers array BEFORE their registration, I guess that would be a little tricky as this will interfere with the signup and registration workflow that Taylor has set up. You'd probably be better off handling this in reverse order after their signup (e.g. based on the UserRegistered Event)

skattabrain's avatar

Does kiosk mode help you? I think it's a big reason for defining developers.

gwa's avatar

Hey Christoph,

the developer Array is just for you and the people who should get access to your Spark backend (can edit Users and see the Metrics) so you should put yourself in it.

For free Accounts I would try the way with coupons, haven't try it but I think that would solve your problem.

Best Max

christophrumpel's avatar

thx @EventFellows but if I setup a free plan, then it would be available to everyone? Guess this is not a solution

@skattabrain Yeah kiosk mode would be nice, but it is just for backend access right now. Maybe there is a way to use it for "free admin accounts".

@gwa thx. I feel like there could be a better build-in solutiion for Spark. Maybe I can talk to Taylor.

Will keep you up with news.

EventFellows's avatar

@christophrumpel

I am not sure if I am getting your scenario then if you want admins without paying but no free plan.

If what you are referring to as admin is something along the lines of administrator in your custome's team you might want to try the Spark::useRoles() option of the SparkServiceProvider that basically enables you to give different roles to user ON the team they work on. It is reflected in the pivot table team_users out of the box.

christophrumpel's avatar

ok maybe I got you wrong @EventFellows what I meant was that I do not want to provide a free plan everyone can choose :-)

So I can define a free plan and only make it available to certain users like admins? Hmm if that works, than this would be great!

EventFellows's avatar

Well, this cannot work - at least not out of the box. In spark the user's registration to your application (= user gets written to the database as a user gets login credentials) is tied to selecting a plan. But selecting a plan can also be a free plan without any payment needed.

As far as I know there is no way (out of the box) for a user to get login credentials without signing up for a plan. So you would not be able to give someone an admin role before he is known to the database (and then simultaniously has a plan, even it is a free plan) .

I still feel I have not understood your setup scenario... sorry. When you say 'admin' - what should this person be admin of? Your entire application or just a team?

christophrumpel's avatar

thx @EventFellows Hmm maybe I the admin thing was confusing. My scenario was like this:

I deployed my application, registered myself and then I need to select a plan. I got a trial and a payed plan. Since I do not want to pay for my own application I needed a way to tell the application that I am a user who does not have to pay :-) I haven't worked a lot with payed plans before and maybe this is why I'm not sure where to handle this.

Zile's avatar

@christophrumpel I think that it's kind of funny how people don't understand you :-) Just to make it clear for myself, I think I have same concerns as you...

I am the developer of some Spark SaaS app, and I am the business owner, and Saas administrator. Do I have to subscribe to my own app?

Who are (in Spark terms) 'developers' anyway? App administrators, team administrators?

christophrumpel's avatar

hey @Zile yeah it is =) But i have admint that my original question maybe wasn't that clear :-)

It also feels like a really dump question :-) But it must be a thing others have to think about too. And before I try to hack my way through I wanted to know who others deal with this scenario and if there is something form Spark I am missing.

EventFellows's avatar
Level 16

Ok, got you. In this case where getting you access as the business owner is a one time thing I would suggest the following as a very simple approach.

  • Create a Spark::freePlan() and all the paid plans you need for your users.
  • Signup yourself for the free plan
  • archive the freePlan for everybody else (there is an ->archived() method on the spark plans available that blocks it for new subscribers but lets existing users keep it)
  • put your own email to the developers array so you can see revenue metrics ets for your own app (you need to run php artisan spark:kpi to update the KPIs and see them as graphics)

Hope that helps.

4 likes
christophrumpel's avatar

@EventFellows thx, I think this is a quite good solution and I think I will go for that thx.

I still feel there should be something an easy feature too to create free accounts for like other devs, test accounts or a family member. Coupons would work too, but it would be easier with sth. like admin or dev accounts that do not need pay.

Zile's avatar

@EventFellows well, that sounds like a perfect workaround. I will give it a try.

Thanks for help!!!

1 like
AntyRace's avatar

Hi, I have similar problem, so i write here. My app have 4 types of users:

  • Buyers (subscription not need it)
  • Sellers (subscription need it)
  • Office workers (subscription not need it, not need $developers array registration)
  • App admins (subscription not need it, $developers array registration)

Any sugestion how to solve this problem?

Regards, AntyRace

EventFellows's avatar

You might want to post a separate posting with some more detail on what you question is specifically.

1 like

Please or to participate in this conversation.