'datetime', 'last_webhook_at' => 'datetime', 'metadata' => 'array', 'webhook_secret' => 'encrypted', ]; protected static function booted(): void { static::creating(function (self $store) { if (! $store->public_id) { $store->public_id = (string) Str::uuid(); } if (! $store->webhook_secret) { $store->webhook_secret = Str::random(48); } }); } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function orders(): HasMany { return $this->hasMany(WooOrder::class); } public function webhookUrl(): string { return rtrim((string) config('app.url'), '/').'/webhooks/woocommerce/'.$this->public_id; } }