for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PragmaRX\Google2FALaravel;
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
class ServiceProvider extends IlluminateServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
* Configure package paths.
private function configurePaths()
$this->publishes([
__DIR__.'/config/config.php' => config_path('google2fa.php'),
]);
}
* Merge configuration.
private function mergeConfig()
$this->mergeConfigFrom(
__DIR__.'/config/config.php', 'google2fa'
);
* Configure translation translations.
private function configureTranslations()
$this->loadTranslationsFrom(__DIR__.'/lang', 'google2fa');
* Merge translations.
private function mergeTranslations()
__DIR__.'/lang' => resource_path('lang/vendor/google2fa')
* Get the services provided by the provider.
* @return array
public function provides()
return ['pragmarx.google2fa'];
* Perform post-registration booting of services.
* @return void
public function boot()
$this->loadTranslationsFrom(__DIR__.'/locales', 'google2fa');
* Register the service provider.
public function register()
$this->app->singleton('pragmarx.google2fa', function ($app) {
return $app->make(Google2FA::class);
});
$this->configurePaths();
$this->mergeConfig();