mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-12 22:49:41 -06:00
61 lines
1.2 KiB
PHP
Executable File
61 lines
1.2 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* NOTICE OF LICENSE.
|
|
*
|
|
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
|
|
* The details is bundled with this project in the file LICENSE.txt.
|
|
*
|
|
* @project UNIT3D
|
|
*
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
* @author Mr.G
|
|
*/
|
|
|
|
namespace App;
|
|
|
|
use Kyslik\ColumnSortable\Sortable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Peer extends Model
|
|
{
|
|
use Sortable;
|
|
|
|
/**
|
|
* The Columns That Are Sortable.
|
|
*
|
|
* @var array
|
|
*/
|
|
public $sortable = [
|
|
'id',
|
|
'agent',
|
|
'uploaded',
|
|
'downloaded',
|
|
'left',
|
|
'seeder',
|
|
'created_at',
|
|
];
|
|
|
|
/**
|
|
* Belongs To A User.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class)->withDefault([
|
|
'username' => 'System',
|
|
'id' => '1',
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Belongs To A Torrent.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function torrent()
|
|
{
|
|
return $this->belongsTo(Torrent::class);
|
|
}
|
|
}
|