belongsTo(Torrent::class, 'torrent'); } /** * Belongs To A User. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function warneduser() { return $this->belongsTo(User::class, 'user_id')->withDefault([ 'username' => 'System', 'id' => '1', ]); } /** * Belongs To A USer. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function staffuser() { return $this->belongsTo(User::class, 'warned_by')->withDefault([ 'username' => 'System', 'id' => '1', ]); } /** * Belongs To A USer. * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function deletedBy() { return $this->belongsTo(User::class, 'deleted_by')->withDefault([ 'username' => 'System', 'id' => '1', ]); } }