Fix incorrect API definitions
This commit is contained in:
		
							parent
							
								
									2a2fc42e37
								
							
						
					
					
						commit
						d1da46c5aa
					
				| @ -20,6 +20,7 @@ class ActivityLogController extends ClientApiController | |||||||
|                 AllowedFilter::exact('ip'), |                 AllowedFilter::exact('ip'), | ||||||
|                 AllowedFilter::partial('event'), |                 AllowedFilter::partial('event'), | ||||||
|             ]) |             ]) | ||||||
|  |             ->allowedSorts(['timestamp']) | ||||||
|             ->paginate(min($request->query('per_page', 50), 100)) |             ->paginate(min($request->query('per_page', 50), 100)) | ||||||
|             ->appends($request->query()); |             ->appends($request->query()); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -73,7 +73,12 @@ class ActivityLog extends Model | |||||||
| 
 | 
 | ||||||
|     public function actor(): MorphTo |     public function actor(): MorphTo | ||||||
|     { |     { | ||||||
|         return $this->morphTo()->withTrashed(); |         $morph = $this->morphTo(); | ||||||
|  |         if (method_exists($morph, 'withTrashed')) { | ||||||
|  |             return $morph->withTrashed(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return $morph; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function subjects() |     public function subjects() | ||||||
|  | |||||||
| @ -35,6 +35,11 @@ class ActivityLogSubject extends Pivot | |||||||
| 
 | 
 | ||||||
|     public function subject() |     public function subject() | ||||||
|     { |     { | ||||||
|         return $this->morphTo()->withTrashed(); |         $morph = $this->morphTo(); | ||||||
|  |         if (method_exists($morph, 'withTrashed')) { | ||||||
|  |             return $morph->withTrashed(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         return $morph; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 DaneEveritt
						DaneEveritt