- Introduced the AnnouncementMedia model, removing soft deletes for a simplified structure. - Added AnnouncementMediaFactory for generating test data with relationships to Announcement and PartnerMedia. - Created migration for the announcement_media table without soft deletes.
25 lines
502 B
PHP
25 lines
502 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class AnnouncementMedia extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
public function announcement(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Announcement::class);
|
|
}
|
|
|
|
public function partnerMedia(): BelongsTo
|
|
{
|
|
return $this->belongsTo(PartnerMedia::class);
|
|
}
|
|
}
|