| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/project-slim/app/Models/ |
Upload File : |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class CompanyProductLink extends BaseModel
{
/**
* The table associated with the model.
*/
protected $table = 'repo_company_product_link';
/**
* The primary key for the model.
*/
protected $primaryKey = 'product_link_id';
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'company_id',
'platform',
'url'
];
/**
* The attributes that should be hidden for serialization.
* Inherits from BaseModel to hide all ID fields
*/
protected $hidden = [
'id',
'product_link_id',
'company_id',
'user_id',
'role_id',
'report_id',
'module_id'
];
/**
* Get the company that owns the product link.
*/
public function company(): BelongsTo
{
return $this->belongsTo(Company::class, 'company_id', 'company_id');
}
/**
* Get formatted platform name.
*/
public function getFormattedPlatformAttribute(): string
{
return match ($this->platform) {
'g2' => 'G2',
'clutch' => 'Clutch',
'capterra' => 'Capterra',
default => ucfirst($this->platform)
};
}
/**
* Get platform icon class.
*/
public function getPlatformIconAttribute(): string
{
return match ($this->platform) {
'g2' => 'fab fa-g2',
'clutch' => 'fas fa-handshake',
'capterra' => 'fas fa-chart-line',
default => 'fas fa-link'
};
}
}