Browse Source

Add a basic service provider for config overwriting.

Taylor Otwell 9 years ago
parent
commit
c1db7050ea
3 changed files with 28 additions and 4 deletions
  1. 4 4
      app/Providers/AppServiceProvider.php
  2. 23 0
      app/Providers/ConfigServiceProvider.php
  3. 1 0
      config/app.php

+ 4 - 4
app/Providers/AppServiceProvider.php

@@ -17,14 +17,14 @@ class AppServiceProvider extends ServiceProvider {
 	/**
 	 * Register any application services.
 	 *
+	 * This service provider is a great spot to register your various container
+	 * bindings with the application. As you can see, we are registering our
+	 * "Registrar" implementation here. You can add your own bindings too!
+	 *
 	 * @return void
 	 */
 	public function register()
 	{
-		// This service provider is a great spot to register your various container
-		// bindings with the application. As you can see, we are registering our
-		// "Registrar" implementation here. You can add your own bindings too!
-
 		$this->app->bind(
 			'Illuminate\Contracts\Auth\Registrar',
 			'App\Services\Registrar'

+ 23 - 0
app/Providers/ConfigServiceProvider.php

@@ -0,0 +1,23 @@
+<?php namespace App\Providers;
+
+use Illuminate\Support\ServiceProvider;
+
+class ConfigServiceProvider extends ServiceProvider {
+
+	/**
+	 * Overwrite any vendor / package configuration.
+	 *
+	 * This service provider is intended to provide a convenient location for you
+	 * to overwrite any "vendor" or package configuration that you may want to
+	 * modify before the application handles the incoming request / command.
+	 *
+	 * @return void
+	 */
+	public function register()
+	{
+		config([
+			//
+		]);
+	}
+
+}

+ 1 - 0
config/app.php

@@ -141,6 +141,7 @@ return [
 		 */
 		'App\Providers\AppServiceProvider',
 		'App\Providers\BusServiceProvider',
+		'App\Providers\ConfigServiceProvider',
 		'App\Providers\EventServiceProvider',
 		'App\Providers\RouteServiceProvider',