class Illuminate / Support / ServiceProvider
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
abstract

ServiceProvider

Properties

protected

$app Application

The application instance.

Default: null
protected

$bootingCallbacks array

All of the registered booting callbacks.

Default: []
protected

$bootedCallbacks array

All of the registered booted callbacks.

Default: []
public static

$publishes array

The paths that should be published.

Default: []
public static

$publishGroups array

The paths that should be published by group.

Default: []

Methods

public

__construct ( $app ) : void

Create a new service provider instance.

Parameters

public

register ( ) : void

Register any application services.

public

booting ( Closure $callback ) : void

Register a booting callback to be run before the "boot" method is called.

Parameters

public

booted ( Closure $callback ) : void

Register a booted callback to be run after the "boot" method is called.

Parameters

public

callBootingCallbacks ( ) : void

Call the registered booting callbacks.

public

callBootedCallbacks ( ) : void

Call the registered booted callbacks.

protected

mergeConfigFrom ( $path , $key ) : void

Merge the given configuration with the existing configuration.

Parameters

  • $path string
  • $key string
protected

loadRoutesFrom ( $path ) : void

Load the given routes file if routes are not already cached.

Parameters

  • $path string
protected

loadViewsFrom ( $path , $namespace ) : void

Register a view file namespace.

Parameters

  • $path string|array
  • $namespace string
protected

loadViewComponentsAs ( $prefix , array $components ) : void

Register the given view components with a custom prefix.

Parameters

  • $prefix string
  • $components array
protected

loadTranslationsFrom ( $path , $namespace ) : void

Register a translation file namespace.

Parameters

  • $path string
  • $namespace string
protected

loadJsonTranslationsFrom ( $path ) : void

Register a JSON translation file path.

Parameters

  • $path string
protected

loadMigrationsFrom ( $paths ) : void

Register database migration paths.

Parameters

  • $paths array|string
deprecated protected

loadFactoriesFrom ( $paths ) : void

Register Eloquent model factory paths.

Parameters

  • $paths array|string
protected

callAfterResolving ( $name , $callback ) : void

Setup an after resolving listener, or fire immediately if already resolved.

Parameters

  • $name string
  • $callback callable
protected

publishes ( array $paths , $groups ) : void

Register paths to be published by the publish command.

Parameters

  • $paths array
  • $groups mixed
protected

ensurePublishArrayInitialized ( $class ) : void

Ensure the publish array for the service provider is initialized.

Parameters

  • $class string
protected

addPublishGroup ( $group , $paths ) : void

Add a publish group / tag to the service provider.

Parameters

  • $group string
  • $paths array
public static

pathsToPublish ( $provider , $group ) : array

Get the paths to publish.

Parameters

  • $provider string|null
  • $group string|null
protected static

pathsForProviderOrGroup ( $provider , $group ) : array

Get the paths for the provider or group (or both).

Parameters

  • $provider string|null
  • $group string|null
protected static

pathsForProviderAndGroup ( $provider , $group ) : array

Get the paths for the provider and group.

Parameters

  • $provider string
  • $group string
public static

publishableProviders ( ) : array

Get the service providers available for publishing.

public static

publishableGroups ( ) : array

Get the groups available for publishing.

public

commands ( $commands ) : void

Register the package's custom Artisan commands.

Parameters

  • $commands array|mixed
public

provides ( ) : array

Get the services provided by the provider.

public

when ( ) : array

Get the events that trigger this service provider to register.

public

isDeferred ( ) : bool

Determine if the provider is deferred.

public static

defaultProviders ( ) : DefaultProviders

Get the default providers for a Laravel application.