| 
									
										
										
										
											2021-06-26 23:23:15 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace BookStack\Traits; | 
					
						
							| 
									
										
										
										
											2020-12-31 02:25:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | use BookStack\Auth\User; | 
					
						
							|  |  |  | use Illuminate\Database\Eloquent\Relations\BelongsTo; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * @property int owned_by | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | trait HasOwner | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Relation for the user that owns this entity. | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function ownedBy(): BelongsTo | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->belongsTo(User::class, 'owned_by'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |