mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 14:06:53 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			807 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			807 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Models;
 | |
| 
 | |
| use Illuminate\Database\Eloquent\Relations\BelongsTo;
 | |
| use Illuminate\Database\Eloquent\Relations\Pivot;
 | |
| use Illuminate\Database\Eloquent\SoftDeletes;
 | |
| 
 | |
| class ActivityLogSubject extends Pivot
 | |
| {
 | |
|     public $incrementing = true;
 | |
|     public $timestamps = false;
 | |
| 
 | |
|     protected $table = 'activity_log_subjects';
 | |
| 
 | |
|     protected $guarded = ['id'];
 | |
| 
 | |
|     public function activityLog(): BelongsTo
 | |
|     {
 | |
|         return $this->belongsTo(ActivityLog::class);
 | |
|     }
 | |
| 
 | |
|     public function subject()
 | |
|     {
 | |
|         $morph = $this->morphTo();
 | |
| 
 | |
|         if (in_array(SoftDeletes::class, class_uses_recursive($morph::class))) {
 | |
|             /** @var self|Backup|UserSSHKey $morph - cannot use traits in doc blocks */
 | |
|             return $morph->withTrashed();
 | |
|         }
 | |
| 
 | |
|         return $morph;
 | |
|     }
 | |
| }
 | 
