2022-05-29 16:19:04 -04:00
|
|
|
<?php
|
|
|
|
|
|
2024-03-12 22:39:16 -04:00
|
|
|
namespace App\Models;
|
2022-05-29 16:19:04 -04:00
|
|
|
|
2025-09-08 13:12:33 -04:00
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
2025-09-24 13:34:19 +02:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2024-03-19 21:12:27 -04:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
2024-10-19 21:00:11 -04:00
|
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
2022-05-29 16:19:04 -04:00
|
|
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
2024-10-19 21:00:11 -04:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
2022-05-29 16:19:04 -04:00
|
|
|
|
|
|
|
|
/**
|
2024-03-12 22:39:16 -04:00
|
|
|
* \App\Models\ActivityLogSubject.
|
2022-05-29 16:19:04 -04:00
|
|
|
*
|
|
|
|
|
* @property int $id
|
|
|
|
|
* @property int $activity_log_id
|
|
|
|
|
* @property int $subject_id
|
|
|
|
|
* @property string $subject_type
|
2025-09-08 13:12:33 -04:00
|
|
|
* @property ActivityLog|null $activityLog
|
|
|
|
|
* @property Model|\Eloquent $subject
|
2022-05-29 16:19:04 -04:00
|
|
|
*
|
2025-09-08 13:12:33 -04:00
|
|
|
* @method static Builder|ActivityLogSubject newModelQuery()
|
|
|
|
|
* @method static Builder|ActivityLogSubject newQuery()
|
|
|
|
|
* @method static Builder|ActivityLogSubject query()
|
2022-05-29 16:19:04 -04:00
|
|
|
*/
|
|
|
|
|
class ActivityLogSubject extends Pivot
|
|
|
|
|
{
|
|
|
|
|
public $incrementing = true;
|
2024-10-19 18:29:44 -04:00
|
|
|
|
2022-05-29 16:19:04 -04:00
|
|
|
public $timestamps = false;
|
|
|
|
|
|
|
|
|
|
protected $table = 'activity_log_subjects';
|
|
|
|
|
|
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
|
|
2024-03-19 21:12:27 -04:00
|
|
|
public function activityLog(): BelongsTo
|
2022-05-29 16:19:04 -04:00
|
|
|
{
|
|
|
|
|
return $this->belongsTo(ActivityLog::class);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-19 21:00:11 -04:00
|
|
|
public function subject(): MorphTo
|
2022-05-29 16:19:04 -04:00
|
|
|
{
|
2024-10-19 21:00:11 -04:00
|
|
|
return $this->morphTo()->withoutGlobalScope(SoftDeletingScope::class);
|
2022-05-29 16:19:04 -04:00
|
|
|
}
|
|
|
|
|
}
|