From b1d81f27693efb347c1efb26ae92aaa70ed934e5 Mon Sep 17 00:00:00 2001 From: AfzalSabbir Date: Sat, 17 Sep 2022 16:38:38 +0600 Subject: [PATCH] Cleanups --- composer.json | 8 ++--- .../{slug-generator.php => sluggenerator.php} | 0 src/SlugGeneratorFacade.php | 2 +- src/SlugGeneratorServiceProvider.php | 36 ++----------------- 4 files changed, 8 insertions(+), 38 deletions(-) rename config/{slug-generator.php => sluggenerator.php} (100%) diff --git a/composer.json b/composer.json index 0f78b29..a1a2ff4 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "autoload": { "psr-4": { - "Afzalsabbir\\SlugGenerator\\": "src/" + "AfzalSabbir\\SlugGenerator\\": "src/" }, "files": [ "src/slug-generator-helpers.php" @@ -39,7 +39,7 @@ }, "autoload-dev": { "psr-4": { - "Afzalsabbir\\SlugGenerator\\Tests\\":"tests/" + "AfzalSabbir\\SlugGenerator\\Tests\\":"tests/" } }, "config": { @@ -53,10 +53,10 @@ "extra": { "laravel": { "providers": [ - "Afzalsabbir\\SlugGenerator\\SlugGeneratorServiceProvider" + "AfzalSabbir\\SlugGenerator\\SlugGeneratorServiceProvider" ], "aliases": { - "Afzalsabbir": "Afzalsabbir\\SlugGenerator\\SlugGeneratorFacade" + "SlugGenerator": "AfzalSabbir\\SlugGenerator\\SlugGeneratorFacade" } } } diff --git a/config/slug-generator.php b/config/sluggenerator.php similarity index 100% rename from config/slug-generator.php rename to config/sluggenerator.php diff --git a/src/SlugGeneratorFacade.php b/src/SlugGeneratorFacade.php index 94ac0b0..dc29f0e 100644 --- a/src/SlugGeneratorFacade.php +++ b/src/SlugGeneratorFacade.php @@ -13,6 +13,6 @@ class SlugGeneratorFacade extends Facade */ protected static function getFacadeAccessor() { - return 'slug-generator'; + return 'SlugGenerator'; } } diff --git a/src/SlugGeneratorServiceProvider.php b/src/SlugGeneratorServiceProvider.php index 784874e..ee7fe8d 100644 --- a/src/SlugGeneratorServiceProvider.php +++ b/src/SlugGeneratorServiceProvider.php @@ -14,40 +14,10 @@ class SlugGeneratorServiceProvider extends ServiceProvider */ public function boot() { - $this->mergeConfigFrom(__DIR__ . '/../config/slug-generator.php', 'sluggenerator'); + $this->mergeConfigFrom(__DIR__ . '/../config/sluggenerator.php', 'sluggenerator'); $this->publishConfig(); //$this->publishTraits(); - - // $this->loadViewsFrom(__DIR__.'/resources/views', 'slug-generator'); - // $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); - // $this->registerRoutes(); - } - - /** - * Register the package routes. - * - * @return void - */ - private function registerRoutes() - { - Route::group($this->routeConfiguration(), function () { - $this->loadRoutesFrom(__DIR__ . '/Http/routes.php'); - }); - } - - /** - * Get route group configuration array. - * - * @return array - */ - private function routeConfiguration() - { - return [ - 'namespace' => "Afzalsabbir\SlugGenerator\Http\Controllers", - 'middleware' => 'api', - 'prefix' => 'api' - ]; } /** @@ -58,7 +28,7 @@ private function routeConfiguration() public function register() { // Register facade - $this->app->singleton('slug-generator', function () { + $this->app->singleton('sluggenerator', function () { return new SlugGenerator; }); } @@ -72,7 +42,7 @@ public function publishConfig() { if ($this->app->runningInConsole()) { $this->publishes([ - __DIR__ . '/../config/slug-generator.php' => config_path('sluggenerator.php'), + __DIR__ . '/../config/sluggenerator.php' => config_path('sluggenerator.php'), ], 'config'); } }