Cleanup models

This commit is contained in:
Graham Campbell
2015-01-01 12:23:17 +00:00
parent a14c28b287
commit a442708062
11 changed files with 79 additions and 84 deletions

View File

@@ -1,6 +1,8 @@
<?php
class Setting extends Eloquent
use Illuminate\Database\Eloquent\Model;
class Setting extends Model
{
protected $fillable = ['name', 'value'];
@@ -20,7 +22,7 @@ class Setting extends Eloquent
// First try finding the setting in the database.
try {
$setting = self::whereName($settingName)->first()->value;
} catch (\ErrorException $e) {
} catch (ErrorException $e) {
// If we don't have a setting, check the env (fallback for original version)
if ($checkEnv) {
if (!($setting = getenv(strtoupper($settingName)))) {
@@ -39,14 +41,12 @@ class Setting extends Eloquent
*
* @param string $setting
*
* @throws Exception
* @throws \Exception
*
* @return void
*/
public static function unknownSettingException($setting)
{
throw new \Exception(
sprintf('Unknown setting %s', $setting)
);
throw new Exception(sprintf('Unknown setting %s', $setting));
}
}