boolfalse/clearcaches

Package for recreating Laravel all caches, and for dropping all DB tables, for flushing all sessions.

v1.1.4 2018-10-01 11:52 UTC

This package is auto-updated.

Last update: 2025-03-20 11:35:21 UTC


README

Total Downloads License

Package for clearing/recreating all Laravel caches, for dropping all DB tables, and flushing all Laravel sessions. It's a package created for easy development. This package is my first created package. So I will glad to hear any advices and suggestions.

Package Installation:

Require this package with composer. It is recommended to only require the package for development.

composer require boolfalse/clearcaches --dev

But I prefer to use this in production level too (sometimes I need this). So you can just install with this:

composer require boolfalse/clearcaches

For Laravel 5.4 and lower versions need to add service provider in config/app.php (or in config.php) to "providers" list array:

Boolfalse\ClearCaches\ClearCachesServiceProvider::class,

For Laravel 5.5 and higher Package have Auto-Discovery functionality, so doesn't require you to manually add the ServiceProvider.

Usage:

Clear all Laravel Caches and Dump Autoload:

php artisan clearcaches

With CLI option 'dump' You can prevent Autoload Dumping:

php artisan --dump='no'

Drop all tables from DB:

php artisan droptables

Flush all Laravel sessions:

php artisan flushsessions
  • For index page: your-domain/dev/clearcaches-check
  • For clearing and recreating caches: your-domain/dev/clearcaches
  • For dropping all DB tables: your-domain/dev/droptables

Update the package:

This command will update this specific package:

composer update boolfalse/clearcaches

Or

composer update boolfalse/clearcaches --lock

For updating all existing packages, just run:

composer update

Remove the package:

NOTE: For Laravel 5.4 and lower versions (for avoid terminal errors) before running command You need to firstly manually remove

Boolfalse\ClearCaches\ClearCachesServiceProvider::class,

service provider from "providers" list array in config/app.php (or in config.php).

composer remove boolfalse/clearcaches

And after that open '/dev/clearcaches' pages for clearing providers config caches; or just run this commands:

php artisan cache:clear
php artisan config:cache

Publishing the package index view:

Available for ^1.0 version

php artisan vendor:publish --provider="Boolfalse\ClearCaches\ClearCachesServiceProvider"

History:

v1.1.5: Added 'flushsessions' command.

v1.1.0: Removed view (for publishing), controller, route

v1.0.12: "minimum-stability" changed to "stable" version.
v1.0.11: Added 'clear-compiled' artisan command.
v1.0.6: Added 'dump' option for 'clearcaches' CLI custom artisan command.
v1.0.5: Added custom artisan commands with appropriate signatures ('clearcaches', 'droptables').
v1.0.4: Ability to publish package index page and have that as 'resources\views\clearcaches\cc.blade.php' file
v1.0.2: Added embed buttons from https://poser.pugx.org/ for README.md