-
Notifications
You must be signed in to change notification settings - Fork 28
[Proposal] @dump blade directive #590
Comments
Wouldn't this just be a simple |
Almost. Additionally checking of var existing is required. And yes it is shortcode for ordinary The complete code is
|
It would be nice to include second param |
@ShahidH It should never exit/die after dumping, because that is not what the |
@ShahidH I agree with @sisve. But additionally I would like to add possibility to specify several variables. Like the following: But first of all I need to know - how can I create a pull request to approve it. Should I assign this issue to someone? Sorry, this is my first attempt to contribute to laravel framework and I haven't any idea what shoul I do |
@kleshch-s You can fork the framework repository, make your changes and then create a pull request. |
Sorry, I do not find it useful. Why add custom directive for code that will be deleted immediately?
|
I think it's a nice addition to the framework, I'm currently using these directives: https://gist.github.com/cheelahim/e51d45f9c837254c8fe9 but renamed the No one created a pull request so far? Couldn't find one. |
Does this functionality make sense? Will you ever have a |
It's just for rapid debugging / testing. Laravel does have a lot of useful helpers, so let's make them available in Blade with a simple directive. It will never make it to production or should be committed in a project but that's not a good argument if you ask me. In that case the |
Also it is easier to type obviously. You can save your keyboard typings, lol. |
There is a specific issue at the moment, in that if you use Details of this can be found in this issue here: Var Dumper - Backwards compatibility error in 3.3.x to 3.4.0 We do use this in production for an admin/backend area that allows us to confirm the output of web services as this display is completely fit for purpose. I personally feel that a |
You can wrap it in a regular php block instead of {{}}.
or simply |
Or use
or
|
Added a PR for this laravel/framework#23364 |
I have created blade directive @Dump and tried to create pull request, but permission error has occured.
I propose to add @Dump blade directive. It can dump all available variables of the current view or user can specify a variable to dump.
It uses dump() funcion of VarDumper.
@dump
to dump all available variables of current viewor
@dump($var)
to dump specified variableIt outputs the following:
@dump
image link
@dump($var)
image link
In my opinion it's very usefull during development project.
Should I post code here or how I can add pull request?
Thanks
The text was updated successfully, but these errors were encountered: