belongsTo('App\User')->select(['name','id','detail','birthday','cell_number','email']); } public function FormData() { return $this->hasMany('App\CooperationData', 'type_id') ->where('model_type' , 'App\Cooperation'); } public function UserData() { return $this->hasMany('App\CooperationData', 'type_id')->where('model_type' , 'App\\User'); } public function setAppointmentAttribute($value) { $carbon = new Carbon(); $date = substr($value, 0, -3); $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); $this->attributes['appointment'] = $date; } } ?>