Laravel'boot'功能没有开火

Aak*_*des 1 laravel

我有一个雄辩的模型中的以下内容

class Bucket extends \Eloquent {

    protected $fillable = ['name'];
    protected $appends = ['slug'];

    public function __construct(){
        $this->key = substr(str_shuffle(MD5(microtime())), 0, 24);
    }

    public static function boot(){

        dd('check');
    }

    public function users(){
        return $this->belongsToMany('User');
    }

    public function getSlugAttribute(){
        return slugify($this->name);
    }

}
Run Code Online (Sandbox Code Playgroud)

但是我能够毫无问题地阅读和更新模型.我觉得每次模型被实例化时都应该调用boot,这是错误的吗?

这是我用来查看所有存储桶的控制器之一

public function index()
{
    return Auth::user()->buckets;
}
Run Code Online (Sandbox Code Playgroud)

noz*_*man 6

在构造函数中,尝试调用

parent::__construct();
Run Code Online (Sandbox Code Playgroud)