👁 查看:Hotspot.php
路径:/home/boguraj1/.trash/app.1/Models/Hotspot.php
大小:737 B · 修改:2026-06-25 22:24:46 · 权限:0644 · 可写
<?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');
    }
}