for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Laravel MultiLang package.
*
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Longman\LaravelMultiLang;
class Config
{
/**
* Config data.
* @var array
protected $data;
* Create a new MultiLang config instance.
* @param array $data
public function __construct(array $data)
$this->data = $data;
}
* Get config parameter
* @param string $key
* @param mixed $default
* @return array|mixed|null
public function get($key = null, $default = null)
$array = $this->data;
if ($key === null) {
return $array;
if (array_key_exists($key, $array)) {
return $array[$key];
foreach (explode('.', $key) as $segment) {
if (is_array($array) && array_key_exists($segment, $array)) {
$array = $array[$segment];
} else {
return $default;