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
Requires
- php: ^7.4|^8.0|^8.1|^8.2|^8.3
- illuminate/console: ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/filesystem: ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
- symfony/finder: ^4.0|^5.0|^6.0|^7.0
This package is not auto-updated.
Last update: 2025-10-20 16:02:05 UTC
README
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!