<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Infos extends Model{ protected $table='infos'; // public function getContentsAttribute($value){ // if(in_array($this->attributes['type'],[2,3,4,5,6])){ // $value=json_decode($value); // if(in_array($this->attributes['type'],[4])){ // $value->img = json_decode($value->img); // } // } // return $value; // } }