codecleaner/laravel-debug-cleaner

Laravel package to remove dump, dd, console statements from code - Compatible with Laravel 7-12+

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/codecleaner/laravel-debug-cleaner

v1.0.0 2025-10-19 17:44 UTC

This package is not auto-updated.

Last update: 2025-10-20 16:02:05 UTC


README

Latest Version License PHP Version

A Laravel package to easily remove debug statements like dump(), dd(), console.log() from your code before deployment.

๐Ÿš€ Compatible with Laravel 7.x to 12.x+ and PHP 7.4 to 8.3+

โœจ Features

  • ๐Ÿ” Scans multiple file types (PHP, JS, TS, Vue, React)
  • ๐Ÿ›ก๏ธ Production-safe with dry-run mode
  • ๐Ÿ’พ Backup option before cleaning
  • โšก Fast and efficient regex patterns
  • ๐ŸŽฏ Excludes vendor, node_modules, storage directories
  • ๐Ÿ“ฆ Zero configuration required

๐Ÿ“ฆ Installation

composer require codecleaner/laravel-debug-cleaner

The package will be auto-discovered by Laravel.

๐ŸŽฏ Usage

Quick Start

# Preview what will be cleaned (recommended first step)
php artisan clean:debug --dry

# Clean app directory
php artisan clean:debug

# Clean entire project
php artisan clean:debug --path=.

Advanced Usage

# Clean specific directory
php artisan clean:debug --path=app/Http/Controllers

# Clean with backup
php artisan clean:debug --backup

# Clean specific file
php artisan clean:debug --path=app/Models/User.php

๐Ÿงน What Gets Removed

PHP Debug Statements

  • dump($variable);
  • dd($data);
  • var_dump($array);
  • print_r($object);
  • error_log('message');

JavaScript Debug Statements

  • console.log('debug');
  • console.error('error');
  • console.warn('warning');
  • console.debug('debug');
  • console.info('info');
  • debugger;

๐Ÿ“ Supported File Types

  • PHP: *.php
  • JavaScript: *.js
  • TypeScript: *.ts
  • Vue: *.vue
  • React: *.jsx, *.tsx

๐Ÿ”ง Laravel Compatibility

Laravel PHP Status
7.x 7.4+ โœ…
8.x 7.4+, 8.0+ โœ…
9.x 8.0+ โœ…
10.x 8.1+ โœ…
11.x 8.2+ โœ…
12.x+ 8.2+ โœ…

โš ๏ธ Safety First

Always run with --dry flag first!

# See what would be changed
php artisan clean:debug --dry --path=.

# Create backups before cleaning
php artisan clean:debug --backup --path=.

๐Ÿš€ Deployment Workflow

# 1. Preview changes
php artisan clean:debug --dry

# 2. Create backup and clean
php artisan clean:debug --backup

# 3. Test your application
php artisan test

# 4. Deploy with confidence! ๐ŸŽ‰

๐Ÿ“ License

MIT License. See LICENSE for details.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“ž Support

If you find this package helpful, please โญ star it on GitHub!