Giter Site home page Giter Site logo

laravel-dump-server's Introduction

Laravel Dump Server

Latest Version on Packagist Total Downloads

Bringing the Symfony Var-Dump Server to Laravel.

This package will give you a dump server, that collects all your dump call outputs, so that it does not interfere with HTTP / API responses.

Installation

You can install the package via composer:

composer require --dev beyondcode/laravel-dump-server

Documentation

You can find the documentation on the Beyond Code website.

Looking for dump on steroids? Check out Laravel Herd!

Herd logo

Herd Pro gives you a powerful interface to help you watch and collect your debug information.

All of your application's dump() and dd() calls will be beautifully formatted and can be filtered from Herd's separate Dump window.

Just keep using dump() as usual โ€“ Herd will take care of the rest.

herd.laravel.com

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

laravel-dump-server's People

Contributors

arubacao avatar bertvanhoekelen avatar bezhermoso avatar chapeupreto avatar devcircus avatar eslym avatar freekmurze avatar gofish543 avatar ilyes512 avatar julianmar avatar laravel-shift avatar mechelon avatar mpociot avatar mstaack avatar nunomaduro avatar paulredmond avatar shokme avatar sschlein avatar taitai42 avatar tortuetorche avatar wotta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-dump-server's Issues

how to make this work for Lumen?

when I install it for Lumen (including copy config file and add its service provider to /bootstrap/app.php), I get this error when running php artisan:

In DumpServerServiceProvider.php line 21:

  Call to undefined function BeyondCode\DumpServer\config_path()

is it possible to use this package in Lumen? if so, what should I do?

dump is only working on port 9912

Package Version: 1.8.0
Laravel 8.83.25
PHP 7.4.13
Tested in Windows and Linux

If changed port for 9913 not print dump information

image

Cannot install with laravel 5.6.*

composer require --dev beyondcode/laravel-dump-server
Using version ^1.1 for beyondcode/laravel-dump-server
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install beyondcode/laravel-dump-server 1.1.1
    - Conclusion: remove symfony/var-dumper v4.0.8
    - Installation request for beyondcode/laravel-dump-server ^1.1 -> satisfiable by beyondcode/laravel-dump-server[1.1.0, 1.1.1].
    - Conclusion: don't install symfony/var-dumper v4.0.8
    - beyondcode/laravel-dump-server 1.1.0 requires symfony/var-dumper ^4.1.1 -> satisfiable by symfony/var-dumper[4.1.x-dev, 4.2.x-dev, v4.1.1].
    - Can only install one of: symfony/var-dumper[4.1.x-dev, v4.0.8].
    - Can only install one of: symfony/var-dumper[4.2.x-dev, v4.0.8].
    - Can only install one of: symfony/var-dumper[v4.1.1, v4.0.8].
    - Installation request for symfony/var-dumper (locked at v4.0.8) -> satisfiable by symfony/var-dumper[v4.0.8].

Do not understand why the version is locked to 4.0.8. No entry in my composer.lock file yet.

Laravel dump-server does not log anything on console

Laravel upgraded from 5.5->5.6 then 5.6-.5.7

I can run following command

php artisan dump-server

shows following:

 [OK] Server listening on tcp://127.0.0.1:9912
 // Quit the server with CONTROL-C.

But

dd($user)

does not log on the console. Instead it shows on the browser.

[Feature Request] Auto-reload when dump.html is changed or dumped

Any plans to provide auto-reload the dump.html file so the developer can immediately see the dump() calls without hitting F5?

This should be easily done by serving the dump.html file with browsersync:
browser-sync start --server --files "./dump.html" --index dump.html
But the html dumped does not have body tag and browsersync requires a body tag to embed its script.

[ISSUE] Laravel 5.4 Support

Hi,

I tried to install this package. But an error message complaint about a little thing here:

vagrant@homestead:~/AppWeb$ composer require beyondcode/laravel-dump-server
Using version ^1.0 for beyondcode/laravel-dump-server
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: symfony/var-dumper[v4.1.1, v3.4.12].
    - Can only install one of: symfony/var-dumper[v4.1.1, v3.4.12].
    - Can only install one of: symfony/var-dumper[v4.1.1, v3.4.12].
    - beyondcode/laravel-dump-server 1.0.0 requires symfony/var-dumper ^4.1.1 -> satisfiable by symfony/var-dumper[v4.1.1].
    - Installation request for beyondcode/laravel-dump-server ^1.0 -> satisfiable by beyondcode/laravel-dump-server[1.0.0].
    - Installation request for symfony/var-dumper (locked at v3.4.12) -> satisfiable by symfony/var-dumper[v3.4.12].

Installation failed, reverting ./composer.json to its original content.

I think this package is be able to be supported for Laravel 5.4.

So, if it does support will you do that?

Thanks

[Proposition] Supporting multi-user

Hello,

when using dump-server with multiple users,
the second user will have a tcp error, adress already in use.

i have an idea, don't know if it's possible, but i would like to have an option to connect to a preexisting dump-server, sort of a master-slave setup, to retrieve all the data.

what do you think ?

Perhaps it's something to go in the VarDumper project, i don't know.

thanks

the order of 'suggestions' has been swapped

when i used the wrong import i got the message

Argument 1 passed to App\Http\Controllers\Admin\ActivityLogController::App\Http\Controllers\Admin{closure}()
must be an instance of Illuminate\Database\Query\Builder,
instance of
Illuminate\Database\Eloquent\Builder given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php on line 1078

that is not true, i have an import use Illuminate\Database\Query\Builder;
but i should have use Illuminate\Database\Eloquent\Builder

and when i switch my import to Illuminate\Database\Eloquent\Builder error message is gone.

Colors

I don't see how to make the output be in colors like the screenshots/demo are showing. Can you put those settings into the readme or somewhere please? thanks!

Using --format=html while debugging unit tests with $this->json(...$args)->dump(); throws exception

Simillar to #9 (I guess?) I'm getting an exception while running unit test and try to debug a request with the ->dump() helper, such as

class CategoryModuleTest extends TestCase
{
    public function testAdminCanAccessCategoriesModule()
    {
        $this->signIn(Admin::first());

        $this->json('GET', route('web.api.lists.categories.index'))
            ->dump()
            ->assertOk()
            ->assertJsonCount(1, 'meta.order');
    }
}
Symfony\Component\Debug\Exception\FatalThrowableError  : Argument 1 passed to Symfony\Component\VarDumper\Dumper\HtmlDumper::dump() must be an instance of Symfony\Component\VarDumper\Cloner\Data, null given, called in C:\path\to\project\vendor\symfony\var-dumper\Command\Descriptor\HtmlDescriptor.php on line 47
--
ย  | ย 
ย  | at C:\path\to\project\vendor\symfony\var-dumper\Dumper\HtmlDumper.php:111
ย  | 107\|
ย  | 108\|     /**
ย  | 109\|      * {@inheritdoc}
ย  | 110\|      */
ย  | > 111\|     public function dump(Data $data, $output = null, array $extraDisplayOptions = array())
ย  | 112\|     {
ย  | 113\|         $this->extraDisplayOptions = $extraDisplayOptions;
ย  | 114\|         $result = parent::dump($data, $output);
ย  | 115\|         $this->dumpId = 'sf-dump-'.mt_rand();
ย  | ย 
ย  | Exception trace:
ย  | ย 
ย  | 1   Symfony\Component\VarDumper\Dumper\HtmlDumper::dump([])
ย  | C:\path\to\project\vendor\symfony\var-dumper\Command\Descriptor\HtmlDescriptor.php:47
ย  | ย 
ย  | 2   Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor::describe(Object(Symfony\Component\Console\Style\SymfonyStyle), Object(Symfony\Component\VarDumper\Cloner\Data), [])
ย  | C:\path\to\project\vendor\beyondcode\laravel-dump-server\src\DumpServerCommand.php:81
ย  | ย 
ย  | 3   BeyondCode\DumpServer\DumpServerCommand::BeyondCode\DumpServer\{closure}(Object(Symfony\Component\VarDumper\Cloner\Data), [])
ย  | C:\path\to\project\vendor\symfony\var-dumper\Server\DumpServer.php:76
ย  | ย 
ย  | 4   Symfony\Component\VarDumper\Server\DumpServer::listen(Object(Closure))
ย  | C:\path\to\project\vendor\beyondcode\laravel-dump-server\src\DumpServerCommand.php:82
ย  | ย 
ย  | 5   BeyondCode\DumpServer\DumpServerCommand::handle()
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29
ย  | ย 
ย  | 6   call_user_func_array([])
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29
ย  | ย 
ย  | 7   Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:87
ย  | ย 
ย  | 8   Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:31
ย  | ย 
ย  | 9   Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Container\Container.php:572
ย  | ย 
ย  | 10  Illuminate\Container\Container::call()
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Console\Command.php:183
ย  | ย 
ย  | 11  Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
ย  | C:\path\to\project\vendor\symfony\console\Command\Command.php:255
ย  | ย 
ย  | 12  Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Console\Command.php:170
ย  | ย 
ย  | 13  Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
ย  | C:\path\to\project\vendor\symfony\console\Application.php:886
ย  | ย 
ย  | 14  Symfony\Component\Console\Application::doRunCommand(Object(BeyondCode\DumpServer\DumpServerCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
ย  | C:\path\to\project\vendor\symfony\console\Application.php:262
ย  | ย 
ย  | 15  Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
ย  | C:\path\to\project\vendor\symfony\console\Application.php:145
ย  | ย 
ย  | 16  Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Console\Application.php:89
ย  | ย 
ย  | 17  Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
ย  | C:\path\to\project\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:122
ย  | ย 
ย  | 18  Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
ย  | C:\path\to\project\artisan:37

The problem here is that $this->currentRequest->route() returns null since the $routeResolver is null and so the $controller stays set to null and HtmlDumper just doesn't like it.

I've solved my issue by adding this to the RequestContextProvider

    /**
     * Get the context.
     *
     * @return array|null
     */
    public function getContext(): ?array
    {
        if ($this->currentRequest === null) {
            return null;
        }

        $controller = null;

        if ($route = $this->currentRequest->route()) {
            $controller = $route->controller;

            if (! $controller && ! is_string($route->action['uses'])) {
                $controller = $route->action['uses'];
            }
        }

        if (app()->runningUnitTests()) {
            $controller = $this->guessPHPUnitTestController($this->currentRequest->server->get('argv'));
        }

        return [
            'uri' => $this->currentRequest->getUri(),
            'method' => $this->currentRequest->getMethod(),
            'controller' => $controller ? $this->cloner->cloneVar(class_basename($controller)) : $controller,
            'identifier' => spl_object_hash($this->currentRequest),
        ];
    }

    /**
     * Try to provide as much information to the dump as possible
     *
     * @param array $args
     *
     * @return string
     */
    private function guessPHPUnitTestController(array $args)
    {
        $controller = TestCase::class;

        var_export($args);

        if (false === in_array('--filter', $args)) {
            return $controller;
        }

        if (preg_match('/^[A-Z][a-zA-Z]+Test$/', $args[2])) {
            return $args[2];
        }

        if (preg_match('/^test[A-Z][0-9a-zA-Z]+/', $args[2])) {
            return $controller . '::' . $args[2];
        }

        return $controller;
    }

which produces
image

If this way is okay for you, I can create PR with this solution :)

[Proposition] Option to hide info block (date, controller, source, file)

It would be helpful to have an option to hide the info block:

 ------------ -------------------------------------- 
  date         Fri, 14 Dec 2018 06:42:36 +0000       
  controller   "HotelsController"                    
  source       HotelsSearchService.php on line 315   
  file         app/Services/HotelsSearchService.php  
 ------------ -------------------------------------- 

In my case I need to dump a lot of data in array, and this blocks take all the space on the screen, make it not comfortable to read and require to scroll a lot. It would be nice to have an option to not show this block.

Force cli output

If I use "php artisan dump-server --format=cli" with a json API, it will output the dump in response instead of the CLI.

not working in docker

Hello. I have instaled laravel v7.28.4, laravel-dump-server v1.6.0, php v7.4 and app working on Docker.

I have a config
image

and when i use dump() in my app i see output in the main app.

My dump server looks like this and dont changes:

image

Help me please fix this issue.

Console `dump()` and `dd()` not outputting items.

I'm not sure if this is connected to #34, or not. I have noticed that when working from the command line and dumping or dd'ing, it is not outputting all items.

I have noticed this in conjunction with the hyn/multi-tenant package also being installed. It appears if I remove either this package or the multi-tenancy package, things return to working normally. I have posted an issue in their repo as well: tenancy/multi-tenant#713

However, I am having a hard time figuring out where the conflict is occurring. While diving through the code, nothing stands out, and also while triggering a manual exception after dumping, there doesn't appear to be any code run from the multi-tenant package.

Any thoughts as to what might be causing this, or where I might look further to try and debug this? Thank you!

Update: after further debugging, it appears this issue remains, even without hyn/multi-tenant installed. So perhaps my suspicion of a conflict with that package was premature.

Also, I wanted to clarify that this is the case when the dump-server is NOT running. Everything outputs fine when it is running.

Unable to install with Laravel 5.7

Since this project has become part of the default packages to be preinstall on the upcoming Laravel, it should be able to be ready (possible to be installed) on laravel/laravel (develop branch). Otherwise no one can even try to test 5.7 as alpha or beta.

`dump` never works, `dd` does

Not sure what more info I can provide? This issue only started recently, dump doesn't write to the dump server anymore, while dd does.

Does not seem to work with latest laravel 8 and dump-server

I am using the latest versions of laravel (v8.11.2) and this library (v1.6.0) without any adjustments to the config file. It used to work pre-laravel 8. I can start the server (php artisan dump-server) and that does seem just fine... but dumps are not being catched.

Are more people having this problem?

Edit:
This fixes it: #72

Bump for 8.0

Laravel 8.0 just released, any idea when this package will support it?

using html format throws error on dump() directives not inside a controller

At first I thought this was an overall problem with the HTML output, but after digging a bit discovered that this occurs only if running dump() directives when not inside a Controller (e.g. from within a closure inside of your routes/web.php file).

Sample case I used was the one from the README file. Running php artisan dump-server worked fine, but when running php artisan dump-server --format=html the result is a FatalThrowableError:

   Symfony\Component\Debug\Exception\FatalThrowableError  : Argument 1 passed to Symfony\Component\VarDumper\Dumper\HtmlDumper::dump() must be an instance of Symfony\Component\VarDumper\Cloner\Data, null given, called in /var/www/html/test-app/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php on line 47

  at /var/www/html/test-app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php:111
    107| 
    108|     /**
    109|      * {@inheritdoc}
    110|      */
  > 111|     public function dump(Data $data, $output = null, array $extraDisplayOptions = array())
    112|     {
    113|         $this->extraDisplayOptions = $extraDisplayOptions;
    114|         $result = parent::dump($data, $output);
    115|         $this->dumpId = 'sf-dump-'.mt_rand();

  Exception trace:

  1   Symfony\Component\VarDumper\Dumper\HtmlDumper::dump([])
      /var/www/html/test-app/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php:47

  2   Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor::describe(Object(Symfony\Component\Console\Style\SymfonyStyle), Object(Symfony\Component\VarDumper\Cloner\Data), [])
      /var/www/html/test-app/vendor/beyondcode/laravel-dump-server/src/DumpServerCommand.php:70

  3   BeyondCode\DumpServer\DumpServerCommand::BeyondCode\DumpServer\{closure}(Object(Symfony\Component\VarDumper\Cloner\Data), [])
      /var/www/html/test-app/vendor/symfony/var-dumper/Server/DumpServer.php:76

  4   Symfony\Component\VarDumper\Server\DumpServer::listen(Object(Closure))
      /var/www/html/test-app/vendor/beyondcode/laravel-dump-server/src/DumpServerCommand.php:71

  5   BeyondCode\DumpServer\DumpServerCommand::handle()
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29

  6   call_user_func_array([])
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29

  7   Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87

  8   Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31

  9   Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Container/Container.php:564

  10  Illuminate\Container\Container::call()
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Console/Command.php:184

  11  Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
      /var/www/html/test-app/vendor/symfony/console/Command/Command.php:251

  12  Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Console/Command.php:171

  13  Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /var/www/html/test-app/vendor/symfony/console/Application.php:886

  14  Symfony\Component\Console\Application::doRunCommand(Object(BeyondCode\DumpServer\DumpServerCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /var/www/html/test-app/vendor/symfony/console/Application.php:262

  15  Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /var/www/html/test-app/vendor/symfony/console/Application.php:145

  16  Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Console/Application.php:89

  17  Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /var/www/html/test-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122

  18  Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
      /var/www/html/test-app/artisan:37

After looking into some of the code, it seems that this is an inconsistency in the describe() method between CliDescriptor and HtmlDescriptor. See below - CliDescriptor checks to see if the $request contains a controller index before invoking the dump() method to output the controller name, whereas HtmlDescriptor does not:

// from Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor, line 51-53
if ($controller = $request['controller']) {
    $rows[] = array('controller', rtrim($this->dumper->dump($controller, true), "\n"));
}
// from Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor, line 47
$controller = "<span class='dumped-tag'>{$this->dumper->dump($request['controller'], true, array('maxDepth' => 0))}</span>";

I was able to get around this in a very hacky way by modifying DumpServerCommand, lines 69-71 to be as follows:

$this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) {
    // workaround for dumping html content when not within a controller
    if (is_null($context['request']['controller'])) {
        $context['request']['controller'] = new Data(["-"]);
    }
    $descriptor->describe($io, $data, $context, $clientId);
 });

To me this is probably something that should be addressed within the Symfony var-dumper package, but I wanted to check with @mpociot to see if this workaround is something worth adding to this package, if temporarily.

Thoughts? Is there a different way to accomplish this that is a bit more elegant? Or, does it even matter - how many people will be dump()-ing things to HTML format from their routes file?

does not work on every request

Hi!

I get inconsistent results with my laravel valet. Below code dumps to dump-server every so often but not on each request. If I remove dump then of course code works as expected each time.

Any ideas what might be the reason for such behaviour?

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TestController extends Controller
{
    public function test(Request $request)
    {
            
        $e =  [
            'foo' => 'bar'
        ];

        dump($request->all());

        return $e;

    }
}

Thanks!

Laravel 9.0

With the release of Laravel 9.0 coming within a week or two; what is the release schedule looking like for this package? Would you like any help?

Support for older Laravel versions

Hi, thanks for making this package, it seems really useful. However, could you provide backwards compatibility? At least for Laravel 5.5.x, since that is an LTS version.

After running composer require beyondcode/laravel-dump-server I get this error:

  Problem 1
    - Can only install one of: symfony/var-dumper[v4.1.1, v3.4.12].
    - Can only install one of: symfony/var-dumper[v4.1.1, v3.4.12].
    - Can only install one of: symfony/var-dumper[v4.1.1, v3.4.12].
    - beyondcode/laravel-dump-server 1.0.0 requires symfony/var-dumper ^4.1.1 -> satisfiable by symfony/var-dumper[v4.1.1].
    - Installation request for beyondcode/laravel-dump-server ^1.0 -> satisfiable by beyondcode/laravel-dump-server[1.0.0].
    - Installation request for symfony/var-dumper (locked at v3.4.12) -> satisfiable by symfony/var-dumper[v3.4.12].

How to use outside of Vagrant Box?

This is working fine (both with Laravel and Lumen) when using homestead and running php artisan dump-server inside of the Vagrant box. How do I configure it to run from outside of the Vagrant box, but listen to the server inside?

I tried changing config 'host' => 'tcp://192.168.10.8:9912' but I get error stream_socket_server(): unable to connect to tcp://192.168.10.8:9912 (Can't assign requested address)

Thanks

Customize host and port

Is it possible to customize the host and port and continuously pipe the output?

Currently, it appears the hostname/port is hard-coded to tcp://127.0.0.1:9912 via config/config.php.

A possible syntax similar to the following is recommended:

# following Laravel "php artisan serve" convention
php artisan dump-server --host="$HOST" --port="$PORT"

This way, we can avoid conflicts with other running services, especially those that allow automatically mapping host/port to local, user-friendly variants. For example, typicode/hotel.

Problem installing Laravel 6

This looks really useful but when I install I get this.
Have tried php artisan config:clear and composer update symfony/var-dumper...

Using version ^1.4 for beyondcode/laravel-dump-server
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for beyondcode/laravel-dump-server ^1.4 -> satisfiable by beyondcode/laravel-dump-server[1.4.0].
- Conclusion: remove symfony/var-dumper v4.4.5
- Conclusion: don't install symfony/var-dumper v4.4.5
- beyondcode/laravel-dump-server 1.4.0 requires symfony/var-dumper ^5.0 -> satisfiable by symfony/var-dumper[5.0.x-dev, 5.1.x-dev, v5.0.0, v5.0.0-BETA1, v5.0.0-BETA2, v5.0.0-RC1, v5.0.1, v5.0.2, v5.0.3, v5.0.4, v5.0.5].
- Can only install one of: symfony/var-dumper[5.0.x-dev, v4.4.5].
- Can only install one of: symfony/var-dumper[5.1.x-dev, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.0, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.0-BETA1, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.0-BETA2, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.0-RC1, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.1, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.2, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.3, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.4, v4.4.5].
- Can only install one of: symfony/var-dumper[v5.0.5, v4.4.5].
- Installation request for symfony/var-dumper (locked at v4.4.5) -> satisfiable by

Incompatible with spatie/laravel-ray

I had installed beyondcode/laravel-dump-server in July 2019, and back then it was working fine. Recently I noticed that neither dump() nor dd() calls showed up anymore in the artisan dump-server output.

Today I finally debugged a dump() call and noticed that the VarDumper::$handler was set to spatie/laravel-ray's handler rather than beyondcode/laravel-dump-server's handler:

VarDumper::setHandler(function ($var) use ($connection) {
$this->app->makeWith(Dumper::class, ['connection' => $connection])->dump($var);
});

Now, I actually didn't install spatie/laravel-ray myself, but instead it came as an indirect dependency of psalm/plugin-laravel (which uses orchestra/testbench).

tl;dr The spatie/laravel-ray package should be marked as incompatible with this package in the composer.json, to prevent other users from running into the same trap.

PS: This reminds me to create separate composer.json files for tools.

problem install on laravel 7

Your requirements could not be resolved to an installable set of packages.

Problem 1

  • Conclusion: don't install laravel/framework v7.0.8
  • Conclusion: don't install laravel/framework v7.0.7
  • Conclusion: don't install laravel/framework v7.0.6 - Conclusion: don't install laravel/framework v7.0.5
  • Conclusion: don't install laravel/framework v7.0.4 - Conclusion: don't install laravel/framework v7.0.3
  • Conclusion: don't install laravel/framework v7.0.2 - Conclusion: don't install laravel/framework v7.0.1
  • beyondcode/laravel-dump-server 1.3.0 requires illuminate/support 5.6.|5.7.|5.8.*|^6.0 -> satisfiable by laravel/framework[v6.0.4,
    --

Controller null ghost issues

Hi,
So I'm going through my dumps on an issue - and firstly - besides the fact that controllers are all null like this:

https://share.getcloudapp.com/4gu4D7O2

I've noticed that it is dumping things which I cannot find in my Git repository or anywhere in my files e.g. as per above screenshot dump of

"Long shot but we are live and yes shenanigans are afoot"

I have searched my Git repo and my Visual studio code and... nothing... thinking of doing a artisan clear cache but any input on what you would do if you were in my situation much appreciated

Searching:
https://share.getcloudapp.com/KounGQZ1
https://share.getcloudapp.com/E0uRdPAg

Thanks!

Dump server not working anymore on Laravel 7.28.4

After upgrading Laravel 7 to latest 7.28.4 version, dump server stopped working. Dump servers starts as usual, but output goes not to terminal but to the browser.

PHP 7.4
Laravel 7.28.4
laravel-dump-server ^1.6

dump-server ignores first dump in MacOS

  • Dump-Server Version: 1.3.0
  • Laravel Version: v6.7.0
  • PHP Version: 7.3.0 , 7.4.0
  • OS: MacOS Catalina 10.15.1

Description:

dump('this text is displayed in web output');
dump('this text is displayed in dump-server output');

While php artisan dump-server is runnig,
first dump(...) result is sent to the output of my application, and the next dumps appears in the dump-server output!

The issue exists in MacOS, but same code is ok on other linux-based os.

anything to be considered?

Issue with Symfony when trying to add this to a setup using Laravel v6


Using version ^1.3 for beyondcode/laravel-dump-server
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing beyondcode/laravel-dump-server (1.3.0): Loading from cache
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Connection.php line 32:

  Argument 1 passed to Symfony\Component\VarDumper\Server\Connection::__const
  ruct() must be of the type string, null given, called in /Users/k/kh/sink/v
  endor/beyondcode/laravel-dump-server/src/DumpServerServiceProvider.php on l
  ine 49

Laravel 5.5?

Any chance for this package to work with Laravel 5.5?

Looking inside the source, looks like it should work. Are there any particular reason why this package depends on 5.6 components?

Laravel 11

Are there plans to upgrade it to Laravel 11?

Support 4 laravel 6.x

Sory this is not an issue, i just want to know if there is a plan of supporting laravel 6>.

Thanks 4 a great pkg

dump or dump-server doesn't seem to work sometimes on WSL

I am using windows 10 pro wsl (ubuntu 18.04lts) with valet for linux and occasionally the laravel dump stops working - both(the cli and on page).

The only thing that helps it work again for a while is restarting the OS.

restarting php7.4-fpm, nginx, valet, clearing composer dump or clearing cache... Nothing works.

not able to install in laravel 6 and php 8

Problem 1
- Root composer.json requires beyondcode/laravel-dump-server ^1.7 -> satisfiable by beyondcode/laravel-dump-server[1.7.0].
- beyondcode/laravel-dump-server 1.7.0 requires symfony/var-dumper ^5.0 -> found symfony/var-dumper[v5.0.0-BETA1, ..., 5.4.x-dev] but the package is fixed to v4.4.34 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Config file naming inconsistency

The package is called laravel-dump-server, so is the command (dump-server)... But the config file is named debug-server. Is there any reason for that?

Regards,

Composer dependency problem with Laravel 5.6

Hey @mpociot,

When trying to pull this into an Laravel 5.6 app, I get this dependecy problem and I cannot install it.

Using version ^1.0 for beyondcode/laravel-dump-server
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for beyondcode/laravel-dump-server ^1.0 -> satisfiable by beyondcode/laravel-dump-server[1.0.0].
- Conclusion: remove symfony/var-dumper v4.0.9
- Conclusion: don't install symfony/var-dumper v4.0.9
- beyondcode/laravel-dump-server 1.0.0 requires symfony/var-dumper ^4.1.1 -> satisfiable by symfony/var-dumper[4.1.x-dev, 4.2.x-dev, v4.1.1].
- Can only install one of: symfony/var-dumper[4.1.x-dev, v4.0.9].
- Can only install one of: symfony/var-dumper[4.2.x-dev, v4.0.9].
- Can only install one of: symfony/var-dumper[v4.1.1, v4.0.9].
- Installation request for symfony/var-dumper (locked at v4.0.9) -> satisfiable by symfony/var-dumper[v4.0.9].

Installation failed, reverting ./composer.json to its original content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.