The Spark developer Kiosk is a special area of your Spark application that is only accessible to developers and provides unique developer-only features such as creating announcements, viewing application revenue, impersonating other users, etc.
Any routes that should only be accessible by developers may use the dev
middleware. All of the default Kiosk routes included with Spark are automatically configured to use this middleware:
Route::get('/dev', ['middleware' => 'dev', function () {
//
}]);
The user accounts which have access to the Kiosk are defined in the $developers
property of the App\Providers\SparkServiceProvider
class. Simply add the e-mail addresses of the accounts you wish to be considered as "developers".
If you would like to dynamically set your developer list, you may use the Spark::developers
method which accepts an array of developer e-mail addresses:
Spark::developers($developers);
Spark includes several Kiosk components out of the box. We'll review each of them and their purpose below.
This component allows you to create announcements for your users. These announcements can be used to announce status updates, new features, links to blog posts, etc. Announcements are a great way to keep your users up to speed on what is going on with your application.
This component displays a variety of performance / revenue metrics for your application, such as monthly recurring revenue, total revenue, new registrations, as well as the number of user subscriptions per plan. This component may be used to get a basic overview of the growth of your application.
This component allows you to search for users by name or e-mail address. The *
character may be used when searching to represent a wildcard. For example, searching for matt*
will return all users with a name that begins with matt
.
You may click the view / magnifying glass icon on a user search result to view that user's profile, which includes a button to impersonate that user, as well as the total revenue generated by that customer.
This component displays a variety of performance / revenue metrics for your application, such as monthly recurring revenue, total revenue, new registrations, as well as the number of user subscriptions per plan. This component may be used to get a basic overview of the growth of your application.
To capture nightly metrics, make sure to schedule the spark:kpi
Artisan command to run nightly in your application's app/Console/Kernel.php
file. Of course, you'll also need to schedule a "Cron" job to run the schedule:run
Artisan command every minute. For more information on scheduled commands, check out the relevant Laravel documentation:
$schedule->command('spark:kpi')->dailyAt('23:55');
Adding your own panels to the Kiosk is a breeze. Simply customize the resources/views/vendor/spark/kiosk.blade.php
view to include an additional tab link and tab panel. You are free to check out the included views as an example of how to write your own Kiosk components. However, you are not required to make your Kiosk panel a Vue component.