Guides
Production
Deploy an OSDD application so no request scans the layer folders, and know which cache to rebuild after a change.
An OSDD application deploys like any Laravel application. php artisan optimize caches everything the layers add:
composer install --no-dev --optimize-autoloader
php artisan migrate --force
php artisan optimize
What optimize caches
| Cache | Command run by optimize | Holds for the layers |
|---|---|---|
| Layers | osdd:cache | The discovered layers, in bootstrap/cache/osdd.php |
| Config | config:cache | The result of every overrideConfigFrom() |
| Routes | route:cache | The web, api and health routes of every withRouting() |
| Events | event:cache | The discovered layer listeners |
| Views | view:cache | The Blade views of every layer |
Skip the layer cache with php artisan optimize --except=osdd, and clear everything with php artisan optimize:clear.
After a change
Each cache keeps its content until it is rebuilt. Run php artisan optimize again after:
- changing a layer's config file:
overrideConfigFrom()does nothing once the config is cached; - changing a layer's
web.phporapi.php. Theconsole.phpandchannels.phpfiles are still loaded with cached routes; - adding a listener while event discovery is on;
- removing a layer with
osdd:remove: the caches still name its classes.
The layer cache refreshes itself after composer install and composer update. A layer copied in by hand, without Composer, stays invisible until php artisan osdd:cache or osdd:clear.
Deploying with --no-scripts
composer install --no-scripts skips php artisan package:discover, so Laravel does not discover the providers of new layers and the layer cache is not refreshed. Run php artisan package:discover yourself before optimize.