Version 10.61.17 of Maravel-Framework allows Maravel Micro-Framework 10.52.20 and Maravelith 10.52.10 to run by default optimized:
Maravel:
"scripts": {
"post-autoload-dump": [
"[$COMPOSER_DEV_MODE -eq 0] && php artisan route:cache || echo artisan route:cache failed",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan config:cache || echo artisan config:cache failed",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan autowiring:cache || echo 'autowiring:cache failed'",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan event:cache || echo artisan event:cache failed"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
Maravelith:
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan route:cache || echo artisan route:cache failed",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan config:cache || echo artisan config:cache failed",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan autowiring:cache || echo 'autowiring:cache failed'",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan event:cache || echo artisan event:cache failed",
"[$COMPOSER_DEV_MODE -eq 0] && php artisan view:cache || echo artisan view:cache failed"
],
"post-update-cmd": [
"[$COMPOSER_DEV_MODE -eq 1] && php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
This means that if the routes or config contain closures , they will NOT be cached.
When in require-dev environment, the maravel-framework-dev service provider will be auto-registered in Maravel Micro-Framework, exposing the development commands.
For docker deploys with :
composer install --no-scripts
The dump-autoload must be run:
composer dump-autoload
or the cache commands must be called when the container starts.
To speed up the execution of class_exists calls, you can use:
composer install --no-interaction --prefer-dist --no-progress --optimize-autoloader --no-scripts --no-dev --classmap-authoritative
NOTE:
Do not use env() helper outside of the config files if the config is cached!

Top comments (0)