@@ -29,8 +29,7 @@ I chose this approach to keep the integrity of site-security, by avoiding the
29
29
30
30
## Considerations
31
31
### Routes
32
- This package adds the routes under ` genealabs/laravel-caffeine ` . Please verify
33
- that these don't collide with your existing routes.
32
+ This package adds the routes under ` genealabs/laravel-caffeine ` .
34
33
35
34
### Dependencies
36
35
- Your project must be running one of the following Laravel versions:
@@ -48,7 +47,6 @@ For Laravel 5.2, follow the directions here: https://github.com/GeneaLabs/larave
48
47
composer require genealabs/laravel-caffeine
49
48
```
50
49
51
-
52
50
2 . ** This is only required for Laravel 5.4 or below:**
53
51
Add the service provider entry in ` config/app.php ` :
54
52
``` php
@@ -57,32 +55,93 @@ For Laravel 5.2, follow the directions here: https://github.com/GeneaLabs/larave
57
55
// ],
58
56
```
59
57
60
- 3 . If you have previously registered the middleware, please remove the following
58
+ 3 . If you are running 5.5 or above, remove the providers entry from ` config/app.php ` .
59
+ 4 . If you have previously registered the middleware, please remove the following
61
60
middleware from ` app/Http/Kernel.php ` :
62
61
``` php
63
62
// protected $middleware = [
64
63
GeneaLabs\LaravelCaffeine\Http\Middleware\LaravelCaffeineDripMiddleware::class,
65
64
// ];
66
65
```
67
66
67
+ ## Upgrad Notes
68
+ ### 0.6.0
69
+ This update changes the config file setting names. Please delete the published
70
+ config file ` config/genealabs-laravel-caffeine.php ` if it exists, and follow the
71
+ configuration instructions below.
72
+
68
73
## Configuration
69
- The following elements are configurable:
70
- - ** domain:** (default: ` url('/') ` ) Change to point to a different domain than
71
- your app. This is useful if you are behind a proxy or load-balancer. ___ Do not use
72
- the ` url() ` helper in the config file.___
73
- - ** route:** (default: ` genealabs/laravel-caffeine/drip ` ) Change to customize
74
- the drip URL in the browser. This is just cosmetic.
75
- - ** dripIntervalInMilliSeconds:** (default: 5 mins) Change to configure the drip
76
- interval.
74
+ ``` php
75
+ return [
76
+ /*
77
+ |--------------------------------------------------------------------------
78
+ | Drip Interval
79
+ |--------------------------------------------------------------------------
80
+ |
81
+ | Here you may configure the interval with which Caffeine for Laravel
82
+ | keeps the session alive. By default this is 5 minutes (expressed
83
+ | in milliseconds). This needs to be shorter than your session
84
+ | lifetime value configured set in "config/session.php".
85
+ |
86
+ | Default: 300000 (int)
87
+ |
88
+ */
89
+ 'dripInterval' => 300000,
90
+
91
+ /*
92
+ |--------------------------------------------------------------------------
93
+ | Domain
94
+ |--------------------------------------------------------------------------
95
+ |
96
+ | You may optionally configure a separate domain that you are running
97
+ | Caffeine for Laravel on. This may be of interest if you have a
98
+ | monitoring service that queries other apps. Setting this to
99
+ | null will use the domain of the current application.
100
+ |
101
+ | Default: null (null|string)
102
+ |
103
+ */
104
+ 'domain' => null,
105
+
106
+ /*
107
+ |--------------------------------------------------------------------------
108
+ | Drip Endpoint URL
109
+ |--------------------------------------------------------------------------
110
+ |
111
+ | Sometimes you may wish to white-label your app and not expose the AJAX
112
+ | request URLs as belonging to this package. To achieve that you can
113
+ | rename the URL used for dripping caffeine into your application.
114
+ |
115
+ | Default: 'genealabs/laravel-caffeine/drip' (string)
116
+ |
117
+ */
118
+ 'route' => 'genealabs/laravel-caffeine/drip', // Customizable end-point URL
119
+
120
+ /*
121
+ |--------------------------------------------------------------------------
122
+ | Checking for Lapsed Drips
123
+ |--------------------------------------------------------------------------
124
+ |
125
+ | If the browser is put to sleep on (for example on mobil devices or
126
+ | laptops), it will still cause an error when trying to submit the
127
+ | form. To avoid this, we force-reload the form 2 minutes prior
128
+ | to session time-out or later. Setting this setting to 0
129
+ | will disable this check if you don't want to use it.
130
+ |
131
+ | Default: 2000 (int)
132
+ |
133
+ */
134
+ 'outdatedDripCheckInterval' => 2000,
135
+
136
+ ];
137
+ ```
77
138
78
139
___ Only publish the config file if you need to customize it___ :
79
140
``` sh
80
- php artisan vendor :publish --tag=genealabs-laravel-caffeine
141
+ php artisan caffeine :publish --config
81
142
```
82
143
83
- You can now change the default value in ` config/genealabs-laravel-caffeine.php ` as desired. Deleting the
84
- ` config/genealabs-laravel-caffeine.php ` file will revert back to the default settings.
85
-
86
144
## Usage
87
- That was it! It will apply itself automatically where it finds a form with a ` _token ` field, or a meta tag named
88
- "csrf-token", while pages are open in browsers.
145
+ That was it! It will apply itself automatically where it finds a form with a
146
+ ` _token ` field, or a meta tag named "csrf-token", while pages are open in
147
+ browsers.
0 commit comments