Initial Spark Install

This commit is contained in:
Deon George
2017-11-03 16:26:07 +11:00
commit b1a5807eb3
766 changed files with 128896 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
//
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@@ -0,0 +1,79 @@
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
// User Related Events...
'Laravel\Spark\Events\Auth\UserRegistered' => [
'Laravel\Spark\Listeners\Subscription\CreateTrialEndingNotification',
],
'Laravel\Spark\Events\Subscription\UserSubscribed' => [
'Laravel\Spark\Listeners\Subscription\UpdateActiveSubscription',
'Laravel\Spark\Listeners\Subscription\UpdateTrialEndingDate',
],
'Laravel\Spark\Events\Profile\ContactInformationUpdated' => [
'Laravel\Spark\Listeners\Profile\UpdateContactInformationOnStripe',
],
'Laravel\Spark\Events\PaymentMethod\VatIdUpdated' => [
'Laravel\Spark\Listeners\Subscription\UpdateTaxPercentageOnStripe',
],
'Laravel\Spark\Events\PaymentMethod\BillingAddressUpdated' => [
'Laravel\Spark\Listeners\Subscription\UpdateTaxPercentageOnStripe',
],
'Laravel\Spark\Events\Subscription\SubscriptionUpdated' => [
'Laravel\Spark\Listeners\Subscription\UpdateActiveSubscription',
],
'Laravel\Spark\Events\Subscription\SubscriptionCancelled' => [
'Laravel\Spark\Listeners\Subscription\UpdateActiveSubscription',
],
// Team Related Events...
'Laravel\Spark\Events\Teams\TeamCreated' => [
'Laravel\Spark\Listeners\Teams\Subscription\CreateTrialEndingNotification',
],
'Laravel\Spark\Events\Teams\Subscription\TeamSubscribed' => [
'Laravel\Spark\Listeners\Teams\Subscription\UpdateActiveSubscription',
'Laravel\Spark\Listeners\Teams\Subscription\UpdateTrialEndingDate',
],
'Laravel\Spark\Events\Teams\Subscription\SubscriptionUpdated' => [
'Laravel\Spark\Listeners\Teams\Subscription\UpdateActiveSubscription',
],
'Laravel\Spark\Events\Teams\Subscription\SubscriptionCancelled' => [
'Laravel\Spark\Listeners\Teams\Subscription\UpdateActiveSubscription',
],
'Laravel\Spark\Events\Teams\UserInvitedToTeam' => [
'Laravel\Spark\Listeners\Teams\CreateInvitationNotification',
],
];
/**
* Register any other events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

View File

@@ -0,0 +1,79 @@
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function map(Router $router)
{
$this->mapWebRoutes($router);
$this->mapApiRoutes($router);
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
protected function mapWebRoutes(Router $router)
{
$router->group([
'namespace' => $this->namespace, 'middleware' => ['web', 'hasTeam'],
], function ($router) {
require base_path('routes/web.php');
});
}
/**
* Define the "api" routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
protected function mapApiRoutes(Router $router)
{
$router->group([
'namespace' => $this->namespace,
'middleware' => 'api',
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
});
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace App\Providers;
use Laravel\Spark\Spark;
use Laravel\Spark\Providers\AppServiceProvider as ServiceProvider;
class SparkServiceProvider extends ServiceProvider
{
/**
* Your application and company details.
*
* @var array
*/
protected $details = [
'vendor' => 'Your Company',
'product' => 'Your Product',
'street' => 'PO Box 111',
'location' => 'Your Town, NY 12345',
'phone' => '555-555-5555',
];
/**
* The address where customer support e-mails should be sent.
*
* @var string
*/
protected $sendSupportEmailsTo = null;
/**
* All of the application developer e-mail addresses.
*
* @var array
*/
protected $developers = [
//
];
/**
* Indicates if the application will expose an API.
*
* @var bool
*/
protected $usesApi = true;
/**
* Finish configuring Spark for the application.
*
* @return void
*/
public function booted()
{
Spark::useStripe()->noCardUpFront()->trialDays(10);
Spark::freePlan()
->features([
'First', 'Second', 'Third'
]);
Spark::plan('Basic', 'provider-id-1')
->price(10)
->features([
'First', 'Second', 'Third'
]);
}
}