murilochianfa/laravel-auto-optimizer
最新稳定版本:v1.0.1
Composer 安装命令:
composer require murilochianfa/laravel-auto-optimizer
包简介
Auto optimize your Laravel application in specific environments.
README 文档
README
Automatically run Laravel optimizer commands based on specific environments. After installing the package, the Laravel optimizer commands will be automatically executed when your application runs in specific environments. This helps ensure optimal performance and responsiveness in production environments.
Features
-
Automatic Optimization: Laravel optimizer commands are automatically executed when your application runs in specific environments, ensuring optimal performance.
-
Customizable Environments: Easily configure the environments in which the optimizer commands should run, allowing flexibility for various project setups.
-
Easy to use Configuration: The package comes with sensible defaults, making it ready to use without extensive setup.
Installation
You can install the package via Composer:
composer require murilochianfa/laravel-auto-optimizer
Next, publish the configuration file:
php artisan vendor:publish --provider="MuriloChianfa\LaravelAutoOptimizer\AutoOptimizerServiceProvider"
Dependencies
- Laravel 10.0 or higher.
- PHP 8.2 or higher.
Configuration
Open the generated configuration file (config/laravel-auto-optimizer.php) and set up the environments and commands to optimize your Laravel application:
<?php return [ /* |-------------------------------------------------------------------------- | Caches the optimizer runs through across environments |-------------------------------------------------------------------------- | | Notice: use this only in production environments, you | can revert the cache manually running config:clear. | | Default: "false" | */ 'cache' => env('APP_PRODUCTION_READY', false), /* |-------------------------------------------------------------------------- | Environments to auto optimize |-------------------------------------------------------------------------- | | Define what environments are able to auto optimize caches. | | Default: "production" | */ 'optimize' => [ 'commands' => [ 'optimize', 'view:cache', 'event:cache', 'route:cache', 'config:cache', 'storage:link', ], 'environments' => [ 'production', ], ], /* |-------------------------------------------------------------------------- | Environments to clear all the caches |-------------------------------------------------------------------------- | | Define what environments is not allowed to be cached. | | Default: "local", "testing" | */ 'clear' => [ 'commands' => [ 'view:clear', 'cache:clear', 'event:clear', 'route:clear', 'config:clear', 'clear-compiled', 'optimize:clear', 'schedule:clear-cache', ], 'environments' => [ 'local', 'testing', ], ], ];
Commitment to Quality
During package development, try as best as possible to embrace good design and development practices to try to ensure that this package is as good as it can be. The checklist for package development includes:
- ✅ Be fully PSR4 and PSR12 compliant.
- ✅ Have no PHPCS warnings throughout all code.
- ✅ Include comprehensive documentation in README.md.
Testing
composer style
Security
If you discover any security related issues, please email murilo.chianfa@outlook.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 740
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-04