| Conditions | 3 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function boot() |
||
| 11 | { |
||
| 12 | if ($this->app->runningInConsole()) { |
||
| 13 | $this->publishes([ |
||
| 14 | __DIR__.'/../config/stripe-webhooks.php' => config_path('stripe-webhooks.php'), |
||
| 15 | ], 'config'); |
||
| 16 | } |
||
| 17 | |||
| 18 | if (! class_exists('CreateStripeWebhookCallsTable')) { |
||
| 19 | $timestamp = date('Y_m_d_His', time()); |
||
| 20 | |||
| 21 | $this->publishes([ |
||
| 22 | __DIR__.'/../database/migrations/create_stripe_webhooks_table.php.stub' => database_path('migrations/'.$timestamp.'_create_stripe_webhooks_table.php'), |
||
| 23 | ], 'migrations'); |
||
| 24 | } |
||
| 25 | |||
| 26 | Route::macro('stripeWebhooks', function ($url) { |
||
| 27 | return Route::post($url, 'Spatie\StripeWebhooks\StripeWebhooksController'); |
||
| 28 | }); |
||
| 29 | } |
||
| 30 | |||
| 36 |