2018-09-10 09:34:57 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Webkul\Customer\Providers;
|
|
|
|
|
|
2020-01-23 12:11:47 +00:00
|
|
|
use Illuminate\Database\Eloquent\Factory as EloquentFactory;
|
2018-09-10 09:34:57 +00:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
use Illuminate\Routing\Router;
|
|
|
|
|
use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer;
|
|
|
|
|
|
|
|
|
|
class CustomerServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
public function boot(Router $router)
|
|
|
|
|
{
|
|
|
|
|
$router->aliasMiddleware('customer', RedirectIfNotCustomer::class);
|
|
|
|
|
|
2018-10-05 12:00:48 +00:00
|
|
|
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'customer');
|
|
|
|
|
|
2019-06-15 11:18:29 +00:00
|
|
|
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
2018-09-10 09:34:57 +00:00
|
|
|
}
|
2020-01-23 12:11:47 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Register services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws \Illuminate\Contracts\Container\BindingResolutionException
|
|
|
|
|
*/
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
|
|
|
|
$this->registerEloquentFactoriesFrom(__DIR__ . '/../Database/Factories');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Register factories.
|
|
|
|
|
*
|
|
|
|
|
* @param string $path
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
* @throws \Illuminate\Contracts\Container\BindingResolutionException
|
|
|
|
|
*/
|
|
|
|
|
protected function registerEloquentFactoriesFrom($path): void
|
|
|
|
|
{
|
|
|
|
|
$this->app->make(EloquentFactory::class)->load($path);
|
|
|
|
|
}
|
2018-09-10 09:34:57 +00:00
|
|
|
}
|