App\Repositories\Setting\ConfigAppSetting::all PHP Method

all() public method

public all ( )
    public function all()
    {
        $url = $this->reader->getConfig('APP_URL');
        $appSetting = new AppSettingEntity();
        $appSetting->setUrl($url);
        return $appSetting;
    }

Usage Example

Example #1
0
    public function test_Should_GetAllAppSettings()
    {
        $config = <<<EOF
APP_URL=http://example.com

EOF;
        $dotenv = vfsStream::newFile('.env')->at($this->rootDir)->setContent($config);
        $dotenvReader = new DotenvReader(new LaravelFilesystem($this->app['files']), vfsStream::url('rootDir/.env'));
        $dotenvWriter = new DotenvWriter(new LaravelFilesystem($this->app['files']), vfsStream::url('rootDir/.env'));
        $configAppSettingRepository = new ConfigAppSetting($dotenvReader, $dotenvWriter);
        $appSettings = $configAppSettingRepository->all();
        $this->assertEquals('http://example.com', $appSettings->getUrl());
    }
ConfigAppSetting