✏️ 编辑:NewspaperPage.php
路径:
/home/boguraj1/.trash/app.1/Models/NewspaperPage.php
大小:900 B · 修改:2026-06-25 22:24:38 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class NewspaperPage extends Model { use HasFactory; protected $fillable = [ 'newspaper_id', 'page_number', 'title', 'image_path', 'thumbnail_path', 'sort_order', ]; public function newspaper() { return $this->belongsTo(Newspaper::class); } public function hotspots() { return $this->hasMany(Hotspot::class)->where('is_active', true); } public function getImageUrlAttribute() { return asset('storage/' . $this->image_path); } public function getThumbnailUrlAttribute() { if ($this->thumbnail_path) { return asset('storage/' . $this->thumbnail_path); } return asset('storage/' . $this->image_path); } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF