Service model, with JSON decoding/encoding of attributes
This commit is contained in:
11
app/models/Service.php
Normal file
11
app/models/Service.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Service extends Eloquent {
|
||||||
|
public function getPropertiesAttribute($properties) {
|
||||||
|
return json_decode($properties);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPropertiesAttribute($properties) {
|
||||||
|
$this->attributes['properties'] = json_encode($properties);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user