<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Hotspot extends Model
{
use HasFactory;
protected $fillable = [
'newspaper_page_id',
'title',
'x_percent',
'y_percent',
'width_percent',
'height_percent',
'link_type',
'link_value',
'is_active',
];
protected $casts = [
'is_active' => 'boolean',
'x_percent' => 'float',
'y_percent' => 'float',
'width_percent' => 'float',
'height_percent' => 'float',
];
public function page()
{
return $this->belongsTo(NewspaperPage::class, 'newspaper_page_id');
}
}