2

I'm using Laravel Spark and I'm reading the docs, but I can't find any method to get a list of my Spark developers. It looks like the only usage I can find that references the protected $developers variable is the middleware which compares an email address with Spark::developer().

Is there anything like Spark::getDevelopers() that would either return the protected array, or a collection of the actual users with matching emails?

I could do this but it seems needlessly expensive:

$users = User::get();
$developers = $users->filter(function ($user) {
    return Spark::developer($user->email);
});
Citizen
  • 12,430
  • 26
  • 76
  • 117

2 Answers2

6

This does the trick without having to modify anything:

$developers = User::whereIn('email', Spark::$developers)->get();
Citizen
  • 12,430
  • 26
  • 76
  • 117
-1

Add this to ManagesAppDetails.php

public static function getDevelopers(){       
   return self::$developers;
}

then you can do:

spark::getDevelopers()

hope this helps!