承接 pfrug/laravel-debug-helpers 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pfrug/laravel-debug-helpers

Composer 安装命令:

composer require pfrug/laravel-debug-helpers

包简介

Useful debugging helpers for Laravel development

README 文档

README

A small set of developer utilities for Laravel. These helpers provide debugging functions that should probably exist in Laravel by default.

Features

Dump helpers

d(...$vars)

Like dump(), but does not stop execution.

dt(...$vars)

Like dump(), but if the variable is arrayable (e.g. Eloquent models), it converts it to array before dumping.

ddt(...$vars)

Same as dt(), but dies after dumping.

You can use these in place of dump() and dd() when working with Eloquent models or arrays.

SqlHelper

SqlHelper::sqlFromBindings($query, $print = true)

Combines toSql() and getBindings() on a query builder or Eloquent builder to output the full SQL string with all bindings inlined.

This is useful for debugging complex queries.

use LaravelDebugHelpers\SqlHelper;

// Complex query with joins and subqueries
$query = User::join('profiles', 'users.id', '=', 'profiles.user_id')
            ->leftJoin('organizations', 'users.organization_id', '=', 'organizations.id')
            ->whereHas('roles', function($q) {
                $q->whereIn('name', ['admin', 'moderator']);
            })
            ->where('users.status', 'active')
            ->where('users.email_verified_at', '!=', null)
            ->where(function($q) {
                $q->where('profiles.is_public', 1)
                  ->orWhere('users.account_type', 'premium');
            })
            ->where('organizations.country', 'US')
            ->where('users.created_at', '>=', now()->subMonths(6))
            ->select('users.id', 'users.name', 'users.email', 'profiles.bio', 'organizations.name as org_name')
            ->orderBy('users.created_at', 'desc')
            ->limit(25);

SqlHelper::sqlFromBindings($query);

Output:

SELECT
    `users`.`id`,
    `users`.`name`,
    `users`.`email`,
    `profiles`.`bio`,
    `organizations`.`name` AS `org_name`
FROM `users`
    INNER JOIN `profiles` ON `users`.`id` = `profiles`.`user_id`
    LEFT JOIN `organizations` ON `users`.`organization_id` = `organizations`.`id`
    WHERE EXISTS (
        SELECT
            *
        FROM `roles`
            INNER JOIN `user_roles` ON `roles`.`id` = `user_roles`.`role_id`
        WHERE `users`.`id` = `user_roles`.`user_id`
            AND `name` IN ('admin', 'moderator')
    )
    AND `users`.`status` = 'active'
    AND `users`.`email_verified_at` IS NOT NULL
    AND (
        `profiles`.`is_public` = 1
        OR
        `users`.`account_type` = 'premium'
    )
    AND `organizations`.`country` = 'US'
    AND `users`.`created_at` >= '2025-04-01 14:26:52'
ORDER BY `users`.`created_at` desc

If $print is false, it returns the SQL string instead of printing and stopping.

Installation

Install via composer:

composer require pfrug/laravel-debug-helpers

If package auto-discovery is disabled, register the service provider manually in config/app.php:

'providers' => [
    LaravelDebugHelpers\DevUtilsServiceProvider::class,
],

Disclaimer

These utilities are intended for development only. Do not leave ddt() or raw SQL dump calls in production environments.

pfrug/laravel-debug-helpers 适用场景与选型建议

pfrug/laravel-debug-helpers 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 745 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「debug」 「helpers」 「development」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 pfrug/laravel-debug-helpers 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 pfrug/laravel-debug-helpers 我们能提供哪些服务?
定制开发 / 二次开发

基于 pfrug/laravel-debug-helpers 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 745
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-16