Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
levizoesch committed Apr 1, 2024
0 parents commit 95212f0
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.idea/*
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Laravel Clear Everything
A simple helper command to clear laravel `routes, config, cache, views, compiled`, and caches `config`.

Composer command
```composer
composer require levizoesch/laravel-clear-everything
```

To run the command
```artisan
php artisan clear-everything
```
34 changes: 34 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "levizoesch/cleareverything",
"type": "project",
"description": "A simple helper command to clear laravel routes, config, cache, views, compiled, and caches config.",
"license": "MIT",
"authors": [
{
"name": "Levi Zoesch",
"email": "[email protected]"
}
],
"keywords": [
"Traqza",
"laravel",
"laravel commands",
"laravel helpers",
"Laravel Clear Everything"
],
"require": {
"php": "^8.0"
},
"autoload": {
"psr-4" : {
"levizoesch\\cleareverything\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"ClearEverythingServiceProvider"
]
}
}
}
27 changes: 27 additions & 0 deletions src/ClearEverything.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace levizoesch\cleareverything;

use Illuminate\Console\Command;

class ClearEverything extends Command
{

protected $signature = 'clear-everything';

protected $description = 'Clears routes, config, cache, views, compiled, and caches config.';

public function __construct()
{
parent::__construct();
}

public function handle()
{
$validCommands = array('route:clear', 'config:clear', 'cache:clear', 'view:clear', 'clear-compiled', 'config:cache');
foreach ($validCommands as $cmd) {
$this->call('' . $cmd . '');

}
}
}
15 changes: 15 additions & 0 deletions src/ClearEverythingServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace levizoesch\cleareverything;

use Illuminate\Support\ServiceProvider;
use levizoesch\cleareverything\ClearEverything;

class ClearEverythingServiceProvider extends ServiceProvider
{
public function boot()
{
$this->commands([
ClearEverything::class
]);
}
}

0 comments on commit 95212f0

Please sign in to comment.