# Url Store Model | DB Table Name | {wp_db_prefix}_fc_url_stores | |---------------|---------------------------------------------------------------------------| | Schema | Check Schema | | Source File | fluent-crm/app/Models/UrlStores.php | | Name Space | FluentCrm\App\Models | | Class | FluentCrm\App\Models\UrlStores | ## Attributes
Attribute Data Type Comment
id Integer
url Text The original full URL
short String Short encoded slug for tracking
created_at Date Time
updated_at Date Time
## Usage Please check Model Basic for Common methods. ### Accessing Attributes ```php $urlStore = FluentCrm\App\Models\UrlStores::find(1); $urlStore->id; // returns id $urlStore->url; // returns the full URL $urlStore->short; // returns the short slug ``` ## Methods All methods are static. ### getUrlSlug($longUrl) Look up or create a short slug for a URL. Normalizes the URL (strips zero-width spaces, decodes HTML entities) and uses an in-memory cache. - Parameters - $longUrl `string` - Returns `string` — the short slug #### Usage ```php $short = FluentCrm\App\Models\UrlStores::getUrlSlug('https://www.example.com/page'); ``` ### getNextShortUrl($num) Generate a base-36 style encoded short string from a number - Parameters - $num `int` - Returns `string` #### Usage ```php $short = FluentCrm\App\Models\UrlStores::getNextShortUrl(100001); ``` ### getRowByShort($short) Look up a UrlStores record by its short slug (case-sensitive BINARY match) - Parameters - $short `string` - Returns `object` or `null` #### Usage ```php $urlStore = FluentCrm\App\Models\UrlStores::getRowByShort('12x'); ```