protected static function boot()
    {
        parent::boot();

        static::creating(function ($comment) {
            $comment->{$comment->getKeyName()} = Uuid::uuid4()->toString();
        });
    }
protected static function boot()
    {
        parent::boot();

        static::creating(function ($comment) {
            $comment->{$comment->getKeyName()} = Uuid::uuid4()->toString();
        });
    }
protected static function boot ( ) { parent :: boot ( ) ; static :: creating ( function ( $ comment ) { $ comment -> { $ comment -> getKeyName ( ) } = Uuid :: uuid4 ( ) -> toString ( ) ; } ) ; }
The model boot function.

@return void
The model boot function .