Skip to content

Commit

Permalink
Merge pull request #85 from thejhnz/patch-1
Browse files Browse the repository at this point in the history
Missing config causing errors (Lumen)
  • Loading branch information
ovanschie authored Jun 17, 2019
2 parents ef41a0f + 81d91ff commit f2dd70a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ You can publish the config file with:
php artisan vendor:publish --provider="Appstract\Opcache\OpcacheServiceProvider" --tag="config"
```

For Lumen:
### For Lumen:
```php
// bootstrap/app.php
$app->register(Appstract\Opcache\OpcacheServiceProvider::class);
$app->configure('opcache');

// config/app.php
// config/app.php (Only if you already have a custom app.php file)
'url' => env('APP_URL'),

// config/opcache.php
'url' => env('OPCACHE_URL', env('APP_URL')),
'verify_ssl' => true,
'headers' => [],
'directories' => [
base_path('app'),
base_path('bootstrap'),
Expand All @@ -50,6 +53,19 @@ Make sure your APP_URL is set correctly in .env.
If you want to set a different url to call the OPcache routes (for use with a load balancer for example),
you can set OPCACHE_URL.

You will also need an encryption key set in your `.env` file. Since Lumen does not have a artisan generate command, you can create a tempoary route to generate one for you.

```php
$router->get('/key', function() {
return 'base64:'.base64_encode(random_bytes(32));
});
```

Put the results in your .env file:
```
APP_KEY=
```

## Usage
Login to your server/vm and run one of the commands.
##### Requests are only excepted from the same IP as the server IP.
Expand Down

0 comments on commit f2dd70a

Please sign in to comment.