<?php

namespace Tylercd100\LERN\Models;

use Illuminate\Database\Eloquent\Model;

class ExceptionModel extends Model {
    protected $table;
    protected $guarded = array('id');
    
    protected $casts = array(
        'data' => 'array'
    );
    
    public function __construct(array $attributes = [])
    {
        $this->table = config('lern.record.table');
        parent::__construct($attributes);
    }
}

<?php

namespace Tylercd100\LERN\Models;

use Illuminate\Database\Eloquent\Model;

class ExceptionModel extends Model {
    protected $table;
    protected $guarded = array('id');

    public function __construct(array $attributes = [])
    {
        $this->table = config('lern.record.table');
        parent::__construct($attributes);
    }

    public function setDataAttribute($value) {
        $this->attributes['data'] = json_encode($value);
    }

    public function getDataAttribute($value) {
        return json_decode($value);
    }
}
--- 
+++ 
@@ -7,18 +7,14 @@
 class ExceptionModel extends Model {
     protected $table;
     protected $guarded = array('id');
-
+    
+    protected $casts = array(
+        'data' => 'array'
+    );
+    
     public function __construct(array $attributes = [])
     {
         $this->table = config('lern.record.table');
         parent::__construct($attributes);
     }
-
-    public function setDataAttribute($value) {
-        $this->attributes['data'] = json_encode($value);
-    }
-
-    public function getDataAttribute($value) {
-        return json_decode($value);
-    }
 }
Use Attribute Casting in Exception Model

No need for the boilerplate code, Laravel 5.0+ has support for `array` type cast which handles JSON properly.