2017 © Pedro Peláez
 

library laravel-artisan-dd

Run dd from your commandline > Supports PHP 5

image

kigamba/laravel-artisan-dd

Run dd from your commandline > Supports PHP 5

  • Friday, August 18, 2017
  • by Kigamba
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Quickly dd anything from the commandline

This package is a fork from the original spatie/laravle-artisan-dd package., (*1)

This package supports PHP 5 while the original package supports PHP 7, (*2)

Latest Version on Packagist Build Status SensioLabsInsight StyleCI Quality Score Total Downloads, (*3)

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

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

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

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using., (*6)

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium., (*7)

We publish all received postcards on our company website., (*8)

Installation

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

composer require kigamba/laravel-artisan-dd

You must register the Kigamba\ArtisanDd\DdCommand in the console kernel., (*10)

// app/Console/Kernel.php

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

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


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

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

you can do this:, (*14)

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

Changelog

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

Testing

bash $ composer test, (*17)

Contributing

Please see CONTRIBUTING for details., (*18)

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker., (*19)

Credits

Idea: Sebastian De Deyne, (*20)

About Spatie

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website., (*21)

License

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

The Versions

18/08 2017

dev-master

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

Run dd from your commandline > Supports PHP 5

  Sources   Download

MIT

The Requires

 

The Development Requires

artisan laravel-artisan-dd kigamba

18/08 2017
04/08 2017
03/08 2017

dev-v1.1.1-p1

dev-v1.1.1-p1 https://github.com/Kigamba/laravel-artisan-dd

Run dd from your commandline > Supports PHP 5

  Sources   Download

MIT

The Requires

 

The Development Requires

artisan laravel-artisan-dd kigamba