File: /var/www/vhosts/uat-api.tsprojects.net/admin.plotterbox.tsprojects.net/app/Models/CmsInfo.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class CmsInfo extends Model
{
use HasFactory, SoftDeletes;
/*
| Customize the names of the timestamps.
*/
const CREATED_AT = 'createdTime';
const UPDATED_AT = 'updatedTime';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'tblCmsInfo';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'typeId',
'description',
'header',
'fileId',
'page',
'display',
'createdBy',
'modifiedBy',
'updatedTime',
'createdTime'
];
/*
* The table relationships name change from snake_case to camelCase.
*
* @var string
*/
public static $snakeAttributes = false;
public function cmsPages()
{
return $this->hasOne(CmsPage::class, 'id', 'typeId');
}
public function users()
{
return $this->hasOne(User::class, 'id', 'createdBy');
}
public function file()
{
return $this->belongsTo(Files::class, 'fileId', 'id');
}
}