-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allow to install laravel 6 minor releases * Updating service provider + defer * Removing the facade * Refactoring/Cleaning
- Loading branch information
1 parent
2089e2a
commit c4bb764
Showing
12 changed files
with
73 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
language: php | ||
|
||
sudo: false | ||
|
||
php: | ||
- 7.2 | ||
- 7.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
<?php namespace Arcanedev\LaravelSettings; | ||
|
||
use Arcanedev\Support\PackageServiceProvider; | ||
use Arcanedev\LaravelSettings\Contracts\Manager as ManagerContract; | ||
use Arcanedev\Support\Providers\PackageServiceProvider; | ||
use Illuminate\Contracts\Support\DeferrableProvider; | ||
|
||
/** | ||
* Class SettingsServiceProvider | ||
* | ||
* @package Arcanedev\LaravelSettings | ||
* @author ARCANEDEV <[email protected]> | ||
*/ | ||
class SettingsServiceProvider extends PackageServiceProvider | ||
class SettingsServiceProvider extends PackageServiceProvider implements DeferrableProvider | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Properties | ||
|
@@ -30,7 +32,7 @@ class SettingsServiceProvider extends PackageServiceProvider | |
/** | ||
* Register the service provider. | ||
*/ | ||
public function register() | ||
public function register(): void | ||
{ | ||
parent::register(); | ||
|
||
|
@@ -42,10 +44,8 @@ public function register() | |
/** | ||
* Boot the service provider. | ||
*/ | ||
public function boot() | ||
public function boot(): void | ||
{ | ||
parent::boot(); | ||
|
||
$this->publishConfig(); | ||
|
||
SettingsManager::$runsMigrations ? $this->loadMigrations() : $this->publishMigrations(); | ||
|
@@ -56,7 +56,7 @@ public function boot() | |
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
public function provides(): array | ||
{ | ||
return [ | ||
Contracts\Manager::class, | ||
|
@@ -70,19 +70,22 @@ public function provides() | |
*/ | ||
|
||
/** | ||
* Register the Settings Manager. | ||
* Register the Settings Manager & Store drivers. | ||
*/ | ||
private function registerSettingsManager() | ||
private function registerSettingsManager(): void | ||
{ | ||
$this->singleton(Contracts\Manager::class, function ($app) { | ||
return new SettingsManager($app); | ||
}); | ||
$this->singleton(ManagerContract::class, SettingsManager::class); | ||
|
||
$this->singleton(Contracts\Store::class, function ($app) { | ||
/** @var \Arcanedev\LaravelSettings\Contracts\Manager $manager */ | ||
$manager = $app[Contracts\Manager::class]; | ||
return $app[ManagerContract::class]->driver(); | ||
}); | ||
|
||
$this->app->extend(ManagerContract::class, function (ManagerContract $manager, $app) { | ||
foreach ($app['config']->get('settings.drivers', []) as $driver => $params) { | ||
$manager->registerStore($driver, $params); | ||
} | ||
|
||
return $manager->driver(); | ||
return $manager; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters