spatie/laravel-artisan-dd
Composer 安装命令:
composer require spatie/laravel-artisan-dd
包简介
Run dd from your commandline
README 文档
README
Laravel's tinker command allows to run any code you want as if you are inside your Laravel app. But if you want to run a single line of code if can be a bit bothersome. You must start up tinker, type the code, press enter, and quit tinker.
This package contains an Artisan command to dd anything from the commandline. No need to start and quit tinker anymore.
# dumps the first user php artisan dd "User::first()"
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
composer require spatie/laravel-artisan-dd
You must register the Spatie\ArtisanDd\DdCommand in the bootstrap file:
// bootstrap/app.php ->withCommands([ \Spatie\ArtisanDd\DdCommand::class, ])
Usage
You can pass any code you want to execute as the first argument. The result will be dumped to the screen.
php artisan dd "bcrypt('secret')";
Multiple pieces of code can be dumped in one go:
php artisan dd "bcrypt('secret')" "bcrypt('another-secret')";
Support for short class names
Under the hood registers short class names using our laravel-tinker-tools package. So instead of
php artisan dd "\App\Models\NewsItem::first()";
you can do this:
php artisan dd "NewsItem::first()";
A word to the wise
This command can run arbitrary code by using PHP's eval. Be aware that this can be potentially dangerous. By default the command will only run in a local environment. You can make it run in other environments by setting an ALLOW_DD_COMMAND enviroment variable to true.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.
Credits
Idea: Sebastian De Deyne
License
The MIT License (MIT). Please see License File for more information.
spatie/laravel-artisan-dd 适用场景与选型建议
spatie/laravel-artisan-dd 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 89.15k 次下载、GitHub Stars 达 161, 最近一次更新时间为 2017 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debug」 「artisan」 「spatie」 「develop」 「laravel-artisan-dd」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 spatie/laravel-artisan-dd 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 spatie/laravel-artisan-dd 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 spatie/laravel-artisan-dd 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Debug your SimpleBus EventBus and CommandBus
nice output for debug functions for PHP 5.3
Collection of handy Laravel artisan commands that most projects needs
Additional artisan commands for Laravel
Receive webhooks in Laravel apps
Analysis module for finding problematical shop data.
统计信息
- 总下载量: 89.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 164
- 点击次数: 23
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-14