定制 spatie/laravel-artisan-dd 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spatie/laravel-artisan-dd

最新稳定版本:2.4.1

Composer 安装命令:

composer require spatie/laravel-artisan-dd

包简介

Run dd from your commandline

README 文档

README

Latest Version on Packagist run-tests Check & fix styling Total Downloads

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.

统计信息

  • 总下载量: 86.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 166
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 163
  • Watchers: 4
  • Forks: 14
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-14