Mcamara\LaravelLocalization\LaravelLocalization::__construct PHP Method

__construct() public method

Creates new instance.
public __construct ( )
    public function __construct()
    {
        $this->app = app();
        $this->configRepository = $this->app['config'];
        $this->view = $this->app['view'];
        $this->translator = $this->app['translator'];
        $this->router = $this->app['router'];
        $this->request = $this->app['request'];
        // set default locale
        $this->defaultLocale = $this->configRepository->get('app.locale');
        $supportedLocales = $this->getSupportedLocales();
        if (empty($supportedLocales[$this->defaultLocale])) {
            throw new UnsupportedLocaleException("Laravel default locale is not in the supportedLocales array.");
        }
    }