Aggregate ladl.link slugs from all platform apps in the link list.
Deploy Ladill Link / deploy (push) Successful in 29s
Deploy Ladill Link / deploy (push) Successful in 29s
Sync QR and storefront short codes from sibling apps via a platform catalog API so My Links shows every ladl.link URL in one place. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,9 +10,14 @@ class ShortLink extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'source_app',
|
||||
'source_kind',
|
||||
'source_ref',
|
||||
'slug',
|
||||
'label',
|
||||
'destination_url',
|
||||
'manage_url',
|
||||
'is_managed_here',
|
||||
'is_active',
|
||||
'clicks_total',
|
||||
'unique_clicks_total',
|
||||
@@ -21,6 +26,7 @@ class ShortLink extends Model
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_managed_here' => 'boolean',
|
||||
'is_active' => 'boolean',
|
||||
'clicks_total' => 'integer',
|
||||
'unique_clicks_total' => 'integer',
|
||||
@@ -57,4 +63,19 @@ class ShortLink extends Model
|
||||
{
|
||||
return $this->expires_at !== null && $this->expires_at->isPast();
|
||||
}
|
||||
|
||||
public function sourceAppLabel(): string
|
||||
{
|
||||
return match ($this->source_app) {
|
||||
'link' => 'Ladill Link',
|
||||
'qrplus' => 'QR Plus',
|
||||
'merchant' => 'Merchant',
|
||||
'events' => 'Events',
|
||||
'mini' => 'Mini',
|
||||
'give' => 'Give',
|
||||
'transfer' => 'Transfer',
|
||||
'platform' => 'Ladill',
|
||||
default => ucfirst((string) $this->source_app),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user