diff --git a/README.md b/README.md index 88a6614..0ffdb36 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,16 @@ We believe in backwards compatability just as much as Trongate, below are the su composer require shitware-ltd/laravel-trongate ``` +## Configuration + +We understand that the default countdown of `5` seconds and `1` second delay before redirect might not suit your needs. + +To fix this, publish the configuration file and modify just to your needs! + +```bash +php artisan vendor:publish --provider="ShitwareLtd\LaravelTrongate\TrongateServiceProvider" --tag="config" +``` + ## License MIT diff --git a/src/TrongateServiceProvider.php b/src/TrongateServiceProvider.php index 65587fc..49bdede 100644 --- a/src/TrongateServiceProvider.php +++ b/src/TrongateServiceProvider.php @@ -10,12 +10,18 @@ class TrongateServiceProvider extends ServiceProvider { public function register() { - + $this->mergeConfigFrom(__DIR__.'./config/trongate.php', 'trongate'); } public function boot(Kernel $kernel) { $this->loadViewsFrom(__DIR__.'/resources/views', 'trongate'); $kernel->pushMiddleware(TrongateMiddleware::class); + + if ($this->app->runningInConsole()) { + $this->publishes([ + __DIR__.'/config/trongate.php' => config_path('trongate.php'), + ], 'config'); + } } } diff --git a/src/config/trongate.php b/src/config/trongate.php new file mode 100644 index 0000000..01bb391 --- /dev/null +++ b/src/config/trongate.php @@ -0,0 +1,14 @@ + 5, +]; diff --git a/src/resources/views/trongate.blade.php b/src/resources/views/trongate.blade.php index ed82ad0..db3649e 100644 --- a/src/resources/views/trongate.blade.php +++ b/src/resources/views/trongate.blade.php @@ -9,6 +9,12 @@
You will be redirected in 5 seconds.
++ You will be redirected in + + {{ config('trongate.countdown') }} + + seconds. +