We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -6,9 +6,8 @@ |
||
| 6 | 6 | use Backpack\Settings\app\Models\Setting as Setting; |
| 7 | 7 | use Config; |
| 8 | 8 | use Illuminate\Routing\Router; |
| 9 | -use Illuminate\Support\Facades\DB; |
|
| 10 | -use Illuminate\Support\ServiceProvider; |
|
| 11 | 9 | use Illuminate\Support\Facades\Schema; |
| 10 | +use Illuminate\Support\ServiceProvider; |
|
| 12 | 11 | use Route; |
| 13 | 12 | |
| 14 | 13 | class SettingsServiceProvider extends ServiceProvider |
@@ -13,75 +13,75 @@ |
||
| 13 | 13 | |
| 14 | 14 | class SettingsServiceProvider extends ServiceProvider |
| 15 | 15 | { |
| 16 | - /** |
|
| 17 | - * Indicates if loading of the provider is deferred. |
|
| 18 | - * |
|
| 19 | - * @var bool |
|
| 20 | - */ |
|
| 21 | - protected $defer = false; |
|
| 16 | + /** |
|
| 17 | + * Indicates if loading of the provider is deferred. |
|
| 18 | + * |
|
| 19 | + * @var bool |
|
| 20 | + */ |
|
| 21 | + protected $defer = false; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Perform post-registration booting of services. |
|
| 25 | - * |
|
| 26 | - * @return void |
|
| 27 | - */ |
|
| 28 | - public function boot() |
|
| 29 | - { |
|
| 30 | - // only use the Settings package if the Settings table is present in the database |
|
| 31 | - if (count(Schema::getColumnListing('settings'))) { |
|
| 32 | - // get all settings from the database |
|
| 33 | - $settings = Setting::all(); |
|
| 23 | + /** |
|
| 24 | + * Perform post-registration booting of services. |
|
| 25 | + * |
|
| 26 | + * @return void |
|
| 27 | + */ |
|
| 28 | + public function boot() |
|
| 29 | + { |
|
| 30 | + // only use the Settings package if the Settings table is present in the database |
|
| 31 | + if (count(Schema::getColumnListing('settings'))) { |
|
| 32 | + // get all settings from the database |
|
| 33 | + $settings = Setting::all(); |
|
| 34 | 34 | |
| 35 | - // bind all settings to the Laravel config, so you can call them like |
|
| 36 | - // Config::get('settings.contact_email') |
|
| 37 | - foreach ($settings as $key => $setting) { |
|
| 38 | - Config::set('settings.'.$setting->key, $setting->value); |
|
| 39 | - } |
|
| 40 | - } |
|
| 35 | + // bind all settings to the Laravel config, so you can call them like |
|
| 36 | + // Config::get('settings.contact_email') |
|
| 37 | + foreach ($settings as $key => $setting) { |
|
| 38 | + Config::set('settings.'.$setting->key, $setting->value); |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - // publish the migrations and seeds |
|
| 43 | - $this->publishes([__DIR__.'/database/migrations/' => database_path('migrations')], 'migrations'); |
|
| 44 | - $this->publishes([__DIR__.'/database/seeds/' => database_path('seeds')], 'seeds'); |
|
| 45 | - } |
|
| 42 | + // publish the migrations and seeds |
|
| 43 | + $this->publishes([__DIR__.'/database/migrations/' => database_path('migrations')], 'migrations'); |
|
| 44 | + $this->publishes([__DIR__.'/database/seeds/' => database_path('seeds')], 'seeds'); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Define the routes for the application. |
|
| 49 | - * |
|
| 50 | - * @param \Illuminate\Routing\Router $router |
|
| 51 | - * |
|
| 52 | - * @return void |
|
| 53 | - */ |
|
| 54 | - public function setupRoutes(Router $router) |
|
| 55 | - { |
|
| 56 | - $router->group(['namespace' => 'Backpack\Settings\app\Http\Controllers'], function ($router) { |
|
| 57 | - // Admin Interface Routes |
|
| 58 | - Route::group(['prefix' => 'admin', 'middleware' => ['web', 'admin']], function () { |
|
| 59 | - // Settings |
|
| 60 | - Route::resource('setting', 'SettingCrudController'); |
|
| 61 | - }); |
|
| 62 | - }); |
|
| 63 | - } |
|
| 47 | + /** |
|
| 48 | + * Define the routes for the application. |
|
| 49 | + * |
|
| 50 | + * @param \Illuminate\Routing\Router $router |
|
| 51 | + * |
|
| 52 | + * @return void |
|
| 53 | + */ |
|
| 54 | + public function setupRoutes(Router $router) |
|
| 55 | + { |
|
| 56 | + $router->group(['namespace' => 'Backpack\Settings\app\Http\Controllers'], function ($router) { |
|
| 57 | + // Admin Interface Routes |
|
| 58 | + Route::group(['prefix' => 'admin', 'middleware' => ['web', 'admin']], function () { |
|
| 59 | + // Settings |
|
| 60 | + Route::resource('setting', 'SettingCrudController'); |
|
| 61 | + }); |
|
| 62 | + }); |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * Register any package services. |
|
| 67 | - * |
|
| 68 | - * @return void |
|
| 69 | - */ |
|
| 70 | - public function register() |
|
| 71 | - { |
|
| 72 | - $this->registerSettings(); |
|
| 73 | - $this->setupRoutes($this->app->router); |
|
| 65 | + /** |
|
| 66 | + * Register any package services. |
|
| 67 | + * |
|
| 68 | + * @return void |
|
| 69 | + */ |
|
| 70 | + public function register() |
|
| 71 | + { |
|
| 72 | + $this->registerSettings(); |
|
| 73 | + $this->setupRoutes($this->app->router); |
|
| 74 | 74 | |
| 75 | - // use this if your package has a config file |
|
| 76 | - // config([ |
|
| 77 | - // 'config/Settings.php', |
|
| 78 | - // ]); |
|
| 79 | - } |
|
| 75 | + // use this if your package has a config file |
|
| 76 | + // config([ |
|
| 77 | + // 'config/Settings.php', |
|
| 78 | + // ]); |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - private function registerSettings() |
|
| 82 | - { |
|
| 83 | - $this->app->bind('settings', function ($app) { |
|
| 84 | - return new Settings($app); |
|
| 85 | - }); |
|
| 86 | - } |
|
| 81 | + private function registerSettings() |
|
| 82 | + { |
|
| 83 | + $this->app->bind('settings', function ($app) { |
|
| 84 | + return new Settings($app); |
|
| 85 | + }); |
|
| 86 | + } |
|
| 87 | 87 | } |