Problem with laravel ORM $append attribute as shown in the figure
phpcn_u1582
phpcn_u1582 2017-05-16 16:48:50
0
2
505

Doesn’t it matter if you just fill in that position?

phpcn_u1582
phpcn_u1582

reply all(2)
小葫芦

The return value of the modified method will be assigned to test1. Your way of writing (an assignment operation) will return true

阿神

Assumption Usermobile. Pseudocode:

class User extends Model
{
    public function getHiddenMobileAttribute($value)
    {
        return Str::substr($this->mobile,0,4).str_repeat('*',8);
    }
}
echo $user->hidden_mobile;
// 156********
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!