eren/laravel-commands
Composer 安装命令:
composer require eren/laravel-commands
包简介
Laravel all custom commands for daily development
README 文档
README
This Laravel package provides custom Artisan commands to simplify common tasks, such as creating symbolic links, deleting files, and generating Contracts and Responses with service provider bindings.
Installation
-
Install the package via Composer:
composer require eren/laravel-commands
-
(Optional) Publish the package configuration file:
php artisan vendor:publish --provider="Eren\LaravelCommands\Providers\LCServiceProvider"
Available Commands
1. storage:link-custom
Create a symbolic link from public/storage to storage/app/public. If the link already exists, it will be skipped. Additionally, it creates an uploads folder if it doesn’t exist.
Usage
php artisan storage:link-custom
Behavior
- Creates a symbolic link:
public/storage→storage/app/public. - Creates an
uploadsfolder instorage/appif it doesn’t exist.
2. files:delete-all
Delete all files from a specified directory. If no path is provided, it defaults to storage/app/uploads.
Usage
php artisan files:delete-all {path?}
Examples
- Delete files from the default
uploadsfolder:php artisan files:delete-all
- Delete files from a custom path:
php artisan files:delete-all /path/to/folder
Behavior
- Deletes all files in the specified directory.
- If no path is provided, it defaults to
storage/app/uploads.
3. make:contract-response
Generate a Contract and Response class, and bind them in a service provider.
Usage
php artisan make:contract-response {name} {--provider=HomeController1Provider}
Examples
- Generate
AuthContractandAuthResponse:php artisan make:contract-response Auth
- Specify a custom service provider:
php artisan make:contract-response Auth --provider=CustomServiceProvider
Behavior
- Creates a Contract class in
app/Http/Contracts/{Name}Contract.php. - Creates a Response class in
app/Http/Responses/{Name}Response.php. - Binds the Contract and Response in the specified service provider (default:
HomeController1Provider). - If the service provider doesn’t exist, it will be created automatically.
Configuration
You can customize the behavior of the package by publishing the configuration file:
-
Publish the configuration file:
php artisan vendor:publish --provider="Eren\LaravelCommands\Providers\LCServiceProvider" -
Update the configuration file located at
config/laravel-commands.php.
Testing
To run the package’s tests, use the following command:
./vendor/bin/phpunit
or
php artisan test
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request.
License
This package is open-source software licensed under the MIT license.
Support
If you encounter any issues or have questions, please open an issue on the GitHub repository.
eren/laravel-commands 适用场景与选型建议
eren/laravel-commands 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 289 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eren/laravel-commands 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eren/laravel-commands 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 289
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-23