2017 © Pedro Peláez
 

library laravel-artisan-dd

Run dd from your commandline

image

spatie/laravel-artisan-dd

Run dd from your commandline

  • Thursday, February 8, 2018
  • by Spatie
  • Repository
  • 5 Watchers
  • 101 Stars
  • 31,731 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 6 Versions
  • 7 % Grown

The README.md

Quickly dd anything from the commandline

Latest Version on Packagist run-tests Check & fix styling Total Downloads, (*1)

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., (*2)

This package contains an Artisan command to dd anything from the commandline. No need to start and quit tinker anymore., (*3)

# dumps the first user
php artisan dd "User::first()"

Support us

, (*4)

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., (*5)

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., (*6)

Installation

You can install the package via composer:, (*7)

composer require spatie/laravel-artisan-dd

You must register the Spatie\ArtisanDd\DdCommand in the console kernel., (*8)

// app/Console/Kernel.php

protected $commands = [
    ...
    \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., (*9)

``` bash php artisan dd "bcrypt('secret')";, (*10)


Multiple pieces of code can be dumped in one go: ``` bash 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, (*11)

php artisan dd "\App\Models\NewsItem::first()"; 

you can do this:, (*12)

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., (*13)

Changelog

Please see CHANGELOG for more information what has changed recently., (*14)

Testing

bash $ composer test, (*15)

Contributing

Please see CONTRIBUTING for details., (*16)

Security

If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker., (*17)

Credits

Idea: Sebastian De Deyne, (*18)

License

The MIT License (MIT). Please see License File for more information., (*19)

The Versions

08/02 2018

dev-master

9999999-dev https://github.com/spatie/laravel-artisan-dd

Run dd from your commandline

  Sources   Download

MIT

The Requires

 

The Development Requires

debug artisan spatie develop laravel-artisan-dd

08/02 2018

2.0.1

2.0.1.0 https://github.com/spatie/laravel-artisan-dd

Run dd from your commandline

  Sources   Download

MIT

The Requires

 

The Development Requires

debug artisan spatie develop laravel-artisan-dd

30/08 2017

2.0.0

2.0.0.0 https://github.com/spatie/laravel-artisan-dd

Run dd from your commandline

  Sources   Download

MIT

The Requires

 

The Development Requires

debug artisan spatie develop laravel-artisan-dd

22/05 2017
15/05 2017

1.0.0

1.0.0.0 https://github.com/spatie/laravel-artisan-dd

Run dd from your commandline

  Sources   Download

MIT

The Requires

 

The Development Requires

debug artisan spatie develop laravel-artisan-dd

15/05 2017

0.0.1

0.0.1.0 https://github.com/spatie/laravel-artisan-dd

Run dd from your commandline

  Sources   Download

MIT

The Requires

 

The Development Requires

debug artisan spatie develop laravel-artisan-dd