The Laravel dumper package improves on the default dumper with useful Laravel-specific enhancements.
You’ll get helpful information for various core Laravel objects, such as:
- Models
- Query Builders
- Service Container
- Database Connections
- Carbon Instances
- Requests and Responses
Take this simple Post
model query, for example, which conveniently outputs the query builder SQL query at the top:
1Illuminate\Database\Eloquent\Builder {#3322 sql: "select `title` from `posts` where `id` = '1'"3 #connection: Illuminate\Database\MySqlConnection {#334 ▶}4 #model: App\Models\Post {#320 …}5 #eagerLoad: []6 …57}
You can expect enhanced output automatically wherever you typically use dd()
and even get the experience with chaining dd()
calls onto the query builder. For example:
1Post::query()->select('title')->where('id', 1)->dd();
Would output something like the following:
If you still want to access the original default dump/dd behavior, you can use the following helper functions:
1// f = full2ddf();3dumpf();
If you’d like to learn more about the difference between the default experience and the enhancements made by the dumper package, check out the Laravel Dumper diffs on GitHub.
You can learn more about this package, get full installation instructions, and view the source code on GitHub.
0 comments:
Post a Comment
Thanks