mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-24 05:39:45 -06:00
68 lines
2.1 KiB
PHP
68 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* NOTICE OF LICENSE.
|
|
*
|
|
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
|
|
* The details is bundled with this project in the file LICENSE.txt.
|
|
*
|
|
* @project UNIT3D Community Edition
|
|
*
|
|
* @author HDVinnie <hdinnovations@protonmail.com>
|
|
*
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\Auditable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* App\Models\Bookmark.
|
|
*
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int $torrent_id
|
|
* @property \Illuminate\Support\Carbon|null $created_at
|
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
* @property-read \App\Models\Torrent $torrent
|
|
* @property-read \App\Models\User $user
|
|
*
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark whereCreatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark whereId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark whereTorrentId($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark whereUpdatedAt($value)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Bookmark whereUserId($value)
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Bookmark extends Model
|
|
{
|
|
use Auditable;
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
}
|