Deng Laravel

.

1. addition of an attribute (acquirer)

  protected $table = 'd_avatar';
    protected $appends = [
        'Demo'
    ];

    /**
     * Model追加属性
     *
     * @param  string  $value
     * @return string
     */
    public function getDemoAttribute($value)
    {
        return 'demo';
    }

 

 

 

 

 

.

Guess you like

Origin www.cnblogs.com/vip-deng-vip/p/12220904.html