# 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 | |
short | String | |
created_at | Date Time | |
updated_at | Date Time |
# Usage
Please check Model Basic for Common methods.
# Accessing Attributes
$urlStore = FluentCrm\App\Models\UrlStores::find(1);
$urlStore->id; // returns id
$urlStore->url; // returns url
.......
1
2
3
4
5
6
2
3
4
5
6
# Fillable Attributes
'url',
'short'
1
2
3
2
3
# Methods
Along with Global Model methods, this model has few helper methods.
# getUrlSlug($longUrl)
Create short url from long url
- Parameters
- $longUrl
string
- $longUrl
- Returns
string
# Usage
$shortUrl = FluentCrm\App\Models\UrlStores::getUrlSlug('https://www.google.com');
1
# getRowByShort($short)
Get UrlStore object by url short
- Parameters
- $short
string
- $short
- Returns
FluentCrm\App\Models\UrlStores
# Usage
$urlStore = FluentCrm\App\Models\UrlStores::getRowByShort('12x');
1