src/Commands/FacadePleaseDelete.php
public function handle()
    {
        $name = $this->argument('name');
        if($name == 'null') {
            $name = $this->ask('Facade Name (e.g Email, Alert, etc)');
        }

        $path_provider = app_path('Providers' . $this->path . $name . 'FacadeServiceProvider.php');
        $path_facade = app_path(config('facadeplease.namespace') . $this->path);
        $this->info($path_provider);
        if(file_exists($path_provider)) {
            $this->info("\n".$name." is founded! The following files will be deleted:\n");
            $this->info('=> ' . $path_facade . $name . "ClassFacade.php");
            $this->info('=> ' . $path_facade . $name . "Facade.php");
            $this->info('=> ' . $path_provider);
            $confirm = $this->confirm("The command can't be undone and some functions may not work. \nDo you wish to contiune?");
            if($confirm == true) {
                $this->info('Deleting service provider ...');
                unlink($path_provider);
                $this->info('Deleting class facade ...');
                unlink($path_facade . $name . 'ClassFacade.php');
                $this->info('Deleting facade ...');
                unlink($path_facade . $name . 'Facade.php');

                // remote from config
                $this->info('Updating config file ...');
                $config_path = config_path('app.php');
                $app_data = file_get_contents($config_path);
                $remove_config = str_replace("'".$name."' => App" . $this->path . config('facadeplease.namespace') . $this->path . $name . "Facade::class,", "", $app_data);
                $remove_config = str_replace("App" . $this->path . 'Providers' . $this->path . $name . "FacadeServiceProvider::class,", "", $remove_config);
                file_put_contents($config_path, $remove_config);

                $this->info('Dumping the autoloader ...');
                exec('composer dump-autoload -o');
                $this->info('Facade deleted successfully!');
            }
        }else{
            $this->error("\n    Facade doesn't exist!\n");
        }
    }
public function handle()
    {
        $name = $this->argument('name');
        if($name == 'null') {
            $name = $this->ask('Facade Name (e.g Email, Alert, etc)');
        }

        $path_provider = app_path('Providers' . $this->path . $name . 'FacadeServiceProvider.php');
        $path_facade = app_path(config('facadeplease.namespace') . $this->path);
        $this->info($path_provider);
        if(file_exists($path_provider)) {
            $this->info("\n".$name." is founded! The following files will be deleted:\n");
            $this->info('=> ' . $path_facade . $name . "ClassFacade.php");
            $this->info('=> ' . $path_facade . $name . "Facade.php");
            $this->info('=> ' . $path_provider);
            $confirm = $this->confirm("The command can't be undone and some functions may not work. \nDo you wish to contiune?");
            if($confirm == true) {
                $this->info('Deleting service provider ...');
                unlink($path_provider);
                $this->info('Deleting class facade ...');
                unlink($path_facade . $name . 'ClassFacade.php');
                $this->info('Deleting facade ...');
                unlink($path_facade . $name . 'Facade.php');

                // remote from config
                $this->info('Updating config file ...');
                $config_path = config_path('app.php');
                $app_data = file_get_contents($config_path);
                $remove_config = str_replace("'".$name."' => App" . $this->path . config('facadeplease.namespace') . $this->path . $name . "Facade::class,", "", $app_data);
                $remove_config = str_replace("App" . $this->path . 'Providers' . $this->path . $name . "FacadeServiceProvider::class,", "", $remove_config);
                file_put_contents($config_path, $remove_config);

                $this->info('Dumping the autoloader ...');
                exec('composer dump-autoload -o');
                $this->info('Facade deleted successfully!');
            }
        }else{
            $this->error("\n    Facade doesn't exist!\n");
        }
    }
Execute the console command.

@return mixed