Skip to content
View as Markdown

Url Store Model

DB Table Name{wp_db_prefix}_fc_url_stores
SchemaCheck Schema
Source Filefluent-crm/app/Models/UrlStores.php
Name SpaceFluentCrm\App\Models
ClassFluentCrm\App\Models\UrlStores

Attributes

AttributeData TypeComment
idInteger
urlTextThe original full URL
shortStringShort encoded slug for tracking
created_atDate Time
updated_atDate 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) static

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) static

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) static

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');