Skip to content

Commit

Permalink
Updating Seo Base class
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Mar 5, 2017
1 parent d878116 commit e03510a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions src/Seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,27 @@ class Seo
/**
* Get the seo config.
*
* @param string $key
* @param mixed|null $default
* @param string|null $key
* @param mixed|null $default
*
* @return mixed
*/
public static function getConfig($key, $default = null)
public static function getConfig($key = null, $default = null)
{
$key = self::KEY.(is_null($key) ? '' : '.'.$key);

return config()->get($key, $default);
}

/**
* Set the seo config.
*
* @param string $key
* @param mixed|null $value
*/
public static function setConfig($key, $value = null)
{
return config(self::KEY.'.'.$key, $default);
config()->set(self::KEY.'.'.$key, $value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function getEnvironmentSetUp($app)
'prefix' => '',
]);

$app['config']->set(Seo::KEY.'.redirector.drivers.config.options.redirects', [
Seo::setConfig('redirector.drivers.config.options.redirects', [
'/non-existing-page-url' => '/existing-page-url',
'/old-blog/{slug}' => '/new-blog/{slug}',
]);
Expand Down

0 comments on commit e03510a

Please sign in to comment.