parent::boot();怎么理解
<?php
namespace App\Models;
.
.
.
use Illuminate\Support\Str;
class User extends Authenticatable
{
.
.
.
protected $hidden = [
'password', 'remember_token',
];
public static function boot()
{
parent::boot();
static::creating(function ($user) {
$user->activation_token = Str::random(10);
});
}
.
.
.
}
推荐文章: