This commit is contained in:
Graham Campbell
2014-12-20 21:20:17 +00:00
parent 26e4361d8a
commit 9d8d89248f
103 changed files with 2478 additions and 2353 deletions
+7 -4
View File
@@ -2,13 +2,14 @@
use Watson\Validating\ValidatingTrait;
class Service extends Eloquent {
class Service extends Eloquent
{
use ValidatingTrait;
protected $rules = [
'type' => 'alpha_dash|required',
'active' => 'required|in:0,1',
'properties' => ''
'properties' => '',
];
/**
@@ -16,7 +17,8 @@ class Service extends Eloquent {
* @param string $properties
* @return object
*/
public function getPropertiesAttribute($properties) {
public function getPropertiesAttribute($properties)
{
return json_decode($properties);
}
@@ -24,7 +26,8 @@ class Service extends Eloquent {
* Sets the properties attribute which auto encodes to a JSON string.
* @param mixed $properties
*/
public function setPropertiesAttribute($properties) {
public function setPropertiesAttribute($properties)
{
$this->attributes['properties'] = json_encode($properties);
}
}