title: Parse Json content in model in Laravel
body: <p>I have a payment and Payment history models</p>
  <blockquote>
  <p>Payment History:</p>
  </blockquote>
  <pre><code>class PaymentHistory extends Model
  {
      public function subscription()
      {
          return $this-&gt;hasOne('App\Models\Payment', 'id','payment_id');
      }
  
  }
  </code></pre>
  <blockquote>
  <p>Payment :</p>
  </blockquote>
  <pre><code>class Payment extends Model
      {
          public function PaymentHistory(){
          return $this-&gt;belongsTo('App\Models\PaymentHistory ','id','payment_id');
      }
      
      }
  </code></pre>
  <p>I have a json column named as response in Payment History table that i want to return it after decoding json data in model function with each and every row</p>
  <p>My query in controller is as follows</p>
  <pre><code> $data = User::with('Payment.PaymentHistory')-&gt;get();
  </code></pre>
  <p>i was trying to do something like this in payment history model:</p>
  <pre><code>   public function json_response() 
      {
          return json_decode($json, TRUE);
      }
  </code></pre>
  <p>Any help is highly appreciated</p>