'json' ]; protected static function booted() { parent::booted(); // TODO: Change the autogenerated stub //todo:消息提醒 self::created(function (Chengjiu $model) { //兑换提醒 }); } public function user() { return $this->belongsTo(User::class)->select(['id', 'nickname', 'headimg', 'mobile', 'mobile_encryption', 'mobile_code']); } public function getPathAttribute($val) { if (empty($val)) { return config('app.url') . '/default/headimg.png'; } return path_to_url($val); } }