Don't throw errors when fetching settings etc

This commit is contained in:
James Brooks
2014-11-19 16:50:54 +00:00
parent 4ab353c954
commit f4f5b6dbcb
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -2,6 +2,12 @@
class Setting extends Eloquent {
public static function get($settingName) {
return self::where('name', $settingName)->first()->value;
try {
$setting = self::where('name', $settingName)->first()->value;
} catch (ErrorException $e) {
$setting = null;
}
return $setting;
}
}