Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
AfzalSabbir committed Sep 17, 2022
1 parent 296524a commit b1d81f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 38 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
},
"autoload": {
"psr-4": {
"Afzalsabbir\\SlugGenerator\\": "src/"
"AfzalSabbir\\SlugGenerator\\": "src/"
},
"files": [
"src/slug-generator-helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"Afzalsabbir\\SlugGenerator\\Tests\\":"tests/"
"AfzalSabbir\\SlugGenerator\\Tests\\":"tests/"
}
},
"config": {
Expand All @@ -53,10 +53,10 @@
"extra": {
"laravel": {
"providers": [
"Afzalsabbir\\SlugGenerator\\SlugGeneratorServiceProvider"
"AfzalSabbir\\SlugGenerator\\SlugGeneratorServiceProvider"
],
"aliases": {
"Afzalsabbir": "Afzalsabbir\\SlugGenerator\\SlugGeneratorFacade"
"SlugGenerator": "AfzalSabbir\\SlugGenerator\\SlugGeneratorFacade"
}
}
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/SlugGeneratorFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class SlugGeneratorFacade extends Facade
*/
protected static function getFacadeAccessor()
{
return 'slug-generator';
return 'SlugGenerator';
}
}
36 changes: 3 additions & 33 deletions src/SlugGeneratorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
];
}

/**
Expand All @@ -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;
});
}
Expand All @@ -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');
}
}
Expand Down

0 comments on commit b1d81f2

Please sign in to comment.