File: /var/www/vhosts/uat-api.tsprojects.net/admin.plotterbox.tsprojects.net/app/Models/BookDetail.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\SoftDeletes;
class BookDetail extends Model
{
use HasFactory, SoftDeletes;
protected $table='tblBookDetails';
public static $snakeAttributes = false;
protected $fillable = [
'bookId',
'metaId',
'ageGroups',
'description',
'dimension',
'personalized',
'excerpt',
'resource',
'downloadFileId',
'createdBy',
'updatedBy',
'customHow',
'printedIn',
'otherInfo',
'weight',
'metric',
];
/**
* The table relationships name change from snake_case to camelCase.
*
* @var string
*/
public function book()
{
return $this->belongsTo(Books::class, 'bookId', 'id');
}
public function createdBy()
{
return $this->belongsTo(User::class, 'createdBy', 'id');
}
public function updatedBy()
{
return $this->belongsTo(User::class, 'updatedBy', 'id');
}
public function metas()
{
return $this->hasMany(BookMeta::class, 'metaId', 'id');
}
}