mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-02 16:29:49 -05:00
update: model phpdocs
- `use` the relation types - Use sentence case - Write better summaries similar to laravel's documentation (don't just repeat the type and the model)
This commit is contained in:
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Announce.
|
||||
@@ -52,21 +53,21 @@ class Announce extends Model
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* Belongs to a torrent.
|
||||
* Get the torrent that was announced.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrents(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the user that announced.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function requests(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Apikey.
|
||||
@@ -30,8 +31,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Apikey extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
@@ -56,11 +55,11 @@ class Apikey extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the user that owns the apikey.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
+14
-12
@@ -21,6 +21,8 @@ use App\Models\Scopes\ApprovedScope;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Application.
|
||||
@@ -69,41 +71,41 @@ class Application extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the application.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Application Has Been Moderated By.
|
||||
* Get the user that moderated the application.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function moderated(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function moderated(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'moderated_by');
|
||||
}
|
||||
|
||||
/**
|
||||
* A Application Has Many Image Proofs.
|
||||
* Get the image proofs for the application.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ApplicationImageProof, $this>
|
||||
* @return HasMany<ApplicationImageProof, $this>
|
||||
*/
|
||||
public function imageProofs(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function imageProofs(): HasMany
|
||||
{
|
||||
return $this->hasMany(ApplicationImageProof::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Application Has Many URL Proofs.
|
||||
* Get the URL proofs for the application.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ApplicationUrlProof, $this>
|
||||
* @return HasMany<ApplicationUrlProof, $this>
|
||||
*/
|
||||
public function urlProofs(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function urlProofs(): HasMany
|
||||
{
|
||||
return $this->hasMany(ApplicationUrlProof::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\ApplicationImageProof.
|
||||
@@ -47,11 +48,11 @@ class ApplicationImageProof extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A Application.
|
||||
* Get the application that owns the image proof.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Application, $this>
|
||||
* @return BelongsTo<Application, $this>
|
||||
*/
|
||||
public function application(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function application(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Application::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\ApplicationUrlProof.
|
||||
@@ -47,11 +48,11 @@ class ApplicationUrlProof extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A Application.
|
||||
* Get the application that owns the URL proof.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Application, $this>
|
||||
* @return BelongsTo<Application, $this>
|
||||
*/
|
||||
public function application(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function application(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Application::class);
|
||||
}
|
||||
|
||||
+14
-7
@@ -19,6 +19,9 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
/**
|
||||
* App\Models\Article.
|
||||
@@ -46,11 +49,11 @@ class Article extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the author of the article.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -59,17 +62,21 @@ class Article extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<Comment, $this>
|
||||
* Get the comments for the article.
|
||||
*
|
||||
* @return MorphMany<Comment, $this>
|
||||
*/
|
||||
public function comments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function comments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Comment::class, 'commentable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<UnreadArticle, $this>
|
||||
* Get the unreads for the article.
|
||||
*
|
||||
* @return HasMany<UnreadArticle, $this>
|
||||
*/
|
||||
public function unreads(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function unreads(): HasMany
|
||||
{
|
||||
return $this->HasMany(UnreadArticle::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
/**
|
||||
* App\Models\Audit.
|
||||
@@ -51,11 +53,11 @@ class Audit extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user who triggered the audit.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -64,9 +66,11 @@ class Audit extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo<Model, $this>
|
||||
* Get the parent auditable model.
|
||||
*
|
||||
* @return MorphTo<Model, $this>
|
||||
*/
|
||||
public function auditable(): \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||
public function auditable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class AutomaticTorrentFreeleech extends Model
|
||||
{
|
||||
@@ -26,31 +27,31 @@ class AutomaticTorrentFreeleech extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A Category.
|
||||
* Get the category that owns automatic torrent freeleech.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Category, $this>
|
||||
* @return BelongsTo<Category, $this>
|
||||
*/
|
||||
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Type.
|
||||
* Get the type that owns automatic torrent freeleech.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Type, $this>
|
||||
* @return BelongsTo<Type, $this>
|
||||
*/
|
||||
public function type(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function type(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Type::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Resolution.
|
||||
* Get the resolution that owns automatic torrent freeleech.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Resolution, $this>
|
||||
* @return BelongsTo<Resolution, $this>
|
||||
*/
|
||||
public function resolution(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function resolution(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Resolution::class);
|
||||
}
|
||||
|
||||
+7
-6
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Ban.
|
||||
@@ -44,11 +45,11 @@ class Ban extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the banned user.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function banneduser(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function banneduser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'owned_by')->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -57,11 +58,11 @@ class Ban extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the staff user who issued the ban.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function staffuser(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function staffuser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by')->withDefault([
|
||||
'username' => 'System',
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\BlockedIp.
|
||||
@@ -43,11 +44,11 @@ class BlockedIp extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the BlockedIp.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\BonEarning.
|
||||
@@ -32,7 +33,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class BonEarning extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -46,11 +47,11 @@ class BonEarning extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Has Many Bon Earning Conditions.
|
||||
* Get the conditions for the bon earning.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<BonEarningCondition, $this>
|
||||
* @return HasMany<BonEarningCondition, $this>
|
||||
*/
|
||||
public function conditions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function conditions(): HasMany
|
||||
{
|
||||
return $this->hasMany(BonEarningCondition::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\BonEarning.
|
||||
@@ -30,7 +31,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class BonEarningCondition extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -44,11 +45,11 @@ class BonEarningCondition extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A Bon Earning.
|
||||
* Get the bon earning that owns the condition.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<BonEarning, $this>
|
||||
* @return BelongsTo<BonEarning, $this>
|
||||
*/
|
||||
public function bonEarning(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function bonEarning(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(BonEarning::class);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class BonExchange extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\BonTransactions.
|
||||
@@ -39,14 +40,14 @@ class BonTransactions extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The Storage Format Of The Model's Date Columns.
|
||||
* The storage format of the model's date columns.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -72,11 +73,11 @@ class BonTransactions extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Sender.
|
||||
* Get the user that sent the bon.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function sender(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function sender(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -85,11 +86,11 @@ class BonTransactions extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Receiver.
|
||||
* Get the user that received the bon.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function receiver(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function receiver(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -98,11 +99,11 @@ class BonTransactions extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To BonExchange.
|
||||
* Get the exchange that was transacted.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<BonExchange, $this>
|
||||
* @return BelongsTo<BonExchange, $this>
|
||||
*/
|
||||
public function exchange(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function exchange(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(BonExchange::class)->withDefault([
|
||||
'value' => 0,
|
||||
|
||||
+13
-12
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Bookmark.
|
||||
@@ -37,11 +38,11 @@ class Bookmark extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the bookmark.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -50,31 +51,31 @@ class Bookmark extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User Setting.
|
||||
* Get the user setting for the user that owns the bookmark.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<UserSetting, $this>
|
||||
* @return BelongsTo<UserSetting, $this>
|
||||
*/
|
||||
public function userSetting(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function userSetting(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(UserSetting::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A History.
|
||||
* Get the history of the bookmarked torrent for the user that owns the bookmark.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<History, $this>
|
||||
* @return BelongsTo<History, $this>
|
||||
*/
|
||||
public function history(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function history(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(History::class, 'user_id', 'user_id')->whereColumn('bookmarks.torrent_id', '=', 'history.torrent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the bookmarked torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Category.
|
||||
@@ -42,7 +43,7 @@ class Category extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -71,21 +72,21 @@ class Category extends Model
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get the torrents for the category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Torrent, $this>
|
||||
* @return HasMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function torrents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Requests.
|
||||
* Get the requests for the category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequest, $this>
|
||||
* @return HasMany<TorrentRequest, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function requests(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequest::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\ChatStatus.
|
||||
@@ -45,11 +46,11 @@ class ChatStatus extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* A Status Has Many Users.
|
||||
* Get the users that have this chat status.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<User, $this>
|
||||
* @return HasMany<User, $this>
|
||||
*/
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function users(): HasMany
|
||||
{
|
||||
return $this->hasMany(User::class, 'chat_status_id', 'id');
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
/**
|
||||
@@ -47,21 +48,21 @@ class Chatroom extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* A User Has Many Messages.
|
||||
* Get the messages in the chat room.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Message, $this>
|
||||
* @return HasMany<Message, $this>
|
||||
*/
|
||||
public function messages(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function messages(): HasMany
|
||||
{
|
||||
return $this->hasMany(Message::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Chat Room Has Many Users.
|
||||
* Get the users in the chat room.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<User, $this>
|
||||
* @return HasMany<User, $this>
|
||||
*/
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function users(): HasMany
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\ClaimedPrize.
|
||||
@@ -39,21 +40,21 @@ class ClaimedPrize extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the user that owns this claimed prize.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to an event.
|
||||
* Get the event that owns this claimed prize.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Event, $this>
|
||||
* @return BelongsTo<Event, $this>
|
||||
*/
|
||||
public function event(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function event(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
+16
-7
@@ -20,6 +20,9 @@ use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
/**
|
||||
* App\Models\Comment.
|
||||
@@ -61,11 +64,11 @@ class Comment extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the comment.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -74,17 +77,21 @@ class Comment extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo<Model, $this>
|
||||
* Get the parent commentable model.
|
||||
*
|
||||
* @return MorphTo<Model, $this>
|
||||
*/
|
||||
public function commentable(): \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||
public function commentable(): MorphTo
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<self, $this>
|
||||
* Get the children comments for this comment.
|
||||
*
|
||||
* @return HasMany<self, $this>
|
||||
*/
|
||||
public function children(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function children(): HasMany
|
||||
{
|
||||
return $this->hasMany(__CLASS__, 'parent_id')->oldest();
|
||||
}
|
||||
@@ -100,6 +107,8 @@ class Comment extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope a query to only include parent comments.
|
||||
*
|
||||
* @param Builder<Comment> $builder
|
||||
*/
|
||||
public function scopeParent(Builder $builder): void
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Conversation extends Model
|
||||
{
|
||||
@@ -32,31 +34,31 @@ class Conversation extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Has many private messages.
|
||||
* Get the private messages for this conversation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<PrivateMessage, $this>
|
||||
* @return HasMany<PrivateMessage, $this>
|
||||
*/
|
||||
public function messages(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function messages(): HasMany
|
||||
{
|
||||
return $this->hasMany(PrivateMessage::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has many users.
|
||||
* Get the users that belong to the conversation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
|
||||
* @return BelongsToMany<User, $this>
|
||||
*/
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function users(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'participants')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Has many participants.
|
||||
* Get the participants for this conversation.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Participant, $this>
|
||||
* @return HasMany<Participant, $this>
|
||||
*/
|
||||
public function participants(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function participants(): HasMany
|
||||
{
|
||||
return $this->hasMany(Participant::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Distributor.
|
||||
@@ -34,7 +35,7 @@ class Distributor extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -48,21 +49,21 @@ class Distributor extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get the torrents for this distributor.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Torrent, $this>
|
||||
* @return HasMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function torrents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrent Requests.
|
||||
* Get the requests for this distributor.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequest, $this>
|
||||
* @return HasMany<TorrentRequest, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function requests(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequest::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Enums\ModerationStatus;
|
||||
use App\Traits\Encryptable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Donation.
|
||||
@@ -72,7 +73,7 @@ class Donation extends Model
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* The Attributes That Are Encrypted.
|
||||
* The attributes that are encrypted.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
@@ -81,21 +82,21 @@ class Donation extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that donated.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Package.
|
||||
* Get the package that was donated.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<DonationPackage, $this>
|
||||
* @return BelongsTo<DonationPackage, $this>
|
||||
*/
|
||||
public function package(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function package(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DonationPackage::class)->withTrashed();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\EmailUpdate.
|
||||
@@ -29,7 +30,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class EmailUpdate extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -56,11 +57,11 @@ class EmailUpdate extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the user that owns the email.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Event.
|
||||
@@ -56,21 +57,21 @@ class Event extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Has many claimed prizes.
|
||||
* Get the claimed prizes for the event.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ClaimedPrize, $this>
|
||||
* @return HasMany<ClaimedPrize, $this>
|
||||
*/
|
||||
public function claimedPrizes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function claimedPrizes(): HasMany
|
||||
{
|
||||
return $this->hasMany(ClaimedPrize::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has many prizes.
|
||||
* Get the available prizes for the event.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Prize, $this>
|
||||
* @return HasMany<Prize, $this>
|
||||
*/
|
||||
public function prizes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function prizes(): HasMany
|
||||
{
|
||||
return $this->hasMany(Prize::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\FailedLoginAttempt.
|
||||
@@ -46,11 +47,11 @@ class FailedLoginAttempt extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that was failed to be logged into.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\FeaturedTorrent.
|
||||
@@ -37,21 +38,21 @@ class FeaturedTorrent extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent that was featured.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that featured the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
+33
-28
@@ -19,6 +19,11 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
/**
|
||||
* App\Models\Forum.
|
||||
@@ -53,97 +58,97 @@ class Forum extends Model
|
||||
protected $guarded = ['id', 'created_at'];
|
||||
|
||||
/**
|
||||
* Has Many Topic.
|
||||
* Get the topics for the forum.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Topic, $this>
|
||||
* @return HasMany<Topic, $this>
|
||||
*/
|
||||
public function topics(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function topics(): HasMany
|
||||
{
|
||||
return $this->hasMany(Topic::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns The Category In Which The Forum Is Located.
|
||||
* Get the category for the forum.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<ForumCategory, $this>
|
||||
* @return BelongsTo<ForumCategory, $this>
|
||||
*/
|
||||
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ForumCategory::class, 'forum_category_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* All posts inside the forum.
|
||||
* Get the posts for the forum.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough<Post, Topic, $this>
|
||||
* @return HasManyThrough<Post, Topic, $this>
|
||||
*/
|
||||
public function posts(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
public function posts(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(Post::class, Topic::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest topic.
|
||||
* Get the forum's last replied topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<Topic, $this>
|
||||
* @return HasOne<Topic, $this>
|
||||
*/
|
||||
public function lastRepliedTopicSlow(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
public function lastRepliedTopicSlow(): HasOne
|
||||
{
|
||||
return $this->hasOne(Topic::class)->ofMany('last_post_created_at', 'max');
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest topic.
|
||||
* Get the last replied topic of the forum (cached).
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Topic, $this>
|
||||
* @return BelongsTo<Topic, $this>
|
||||
*/
|
||||
public function lastRepliedTopic(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function lastRepliedTopic(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Topic::class, 'last_topic_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest poster.
|
||||
* Get the latest poster of the forum (cached).
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function latestPoster(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function latestPoster(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'last_post_user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Subscriptions.
|
||||
* Get the subscriptions for the forum.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Subscription, $this>
|
||||
* @return HasMany<Subscription, $this>
|
||||
*/
|
||||
public function subscriptions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function subscriptions(): HasMany
|
||||
{
|
||||
return $this->hasMany(Subscription::class, 'forum_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Permissions.
|
||||
* Get the permissions for the forum.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ForumPermission, $this>
|
||||
* @return HasMany<ForumPermission, $this>
|
||||
*/
|
||||
public function permissions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function permissions(): HasMany
|
||||
{
|
||||
return $this->hasMany(ForumPermission::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To Many Subscribed Users.
|
||||
* Get the users that are subscribed to the forum.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
|
||||
* @return BelongsToMany<User, $this>
|
||||
*/
|
||||
public function subscribedUsers(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function subscribedUsers(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, Subscription::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Only include forums a user is authorized to.
|
||||
* Scope a query to only include forums a user is authorized to.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder<self> $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder<self>
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
|
||||
/**
|
||||
* App\Models\Forum.
|
||||
@@ -46,21 +48,21 @@ class ForumCategory extends Model
|
||||
protected $guarded = ['id', 'created_at'];
|
||||
|
||||
/**
|
||||
* Has Many Sub Topics.
|
||||
* Has the topics for the category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough<Topic, Forum, $this>
|
||||
* @return HasManyThrough<Topic, Forum, $this>
|
||||
*/
|
||||
public function topics(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
public function topics(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(Topic::class, Forum::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Sub Forums.
|
||||
* Get the forums for the category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Forum, $this>
|
||||
* @return HasMany<Forum, $this>
|
||||
*/
|
||||
public function forums(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function forums(): HasMany
|
||||
{
|
||||
return $this->hasMany(Forum::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Permission.
|
||||
@@ -38,12 +39,17 @@ class ForumPermission extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Tells Laravel To Not Maintain The Timestamp Columns.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
public $guarded = [];
|
||||
|
||||
/**
|
||||
@@ -61,21 +67,21 @@ class ForumPermission extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Group.
|
||||
* Get the group associated with the permission.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Group, $this>
|
||||
* @return BelongsTo<Group, $this>
|
||||
*/
|
||||
public function group(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function group(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Group::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Forum.
|
||||
* Get the forum associated with the permission.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Forum, $this>
|
||||
* @return BelongsTo<Forum, $this>
|
||||
*/
|
||||
public function forum(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function forum(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Forum::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\FreeleechToken.
|
||||
@@ -37,21 +38,21 @@ class FreeleechToken extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent the freeleech token was redeemed on.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that redeemed the freeleech token.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
+9
-4
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Gift.
|
||||
@@ -47,17 +48,21 @@ class Gift extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that sent the gift.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function sender(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function sender(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that received the gift.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function recipient(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function recipient(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Group.
|
||||
@@ -129,28 +130,28 @@ class Group extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Has Many Users.
|
||||
* Get the users for the group.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<User, $this>
|
||||
* @return HasMany<User, $this>
|
||||
*/
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function users(): HasMany
|
||||
{
|
||||
return $this->hasMany(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Permissions.
|
||||
* Get the forum permissions for the group.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ForumPermission, $this>
|
||||
* @return HasMany<ForumPermission, $this>
|
||||
*/
|
||||
public function permissions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function permissions(): HasMany
|
||||
{
|
||||
return $this->hasMany(ForumPermission::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
@@ -48,14 +49,14 @@ class History extends Model
|
||||
use SoftDeletes;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'history';
|
||||
|
||||
/**
|
||||
* The Attributes That Are Mass Assignable.
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
@@ -76,11 +77,11 @@ class History extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user associated with the history.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -89,11 +90,11 @@ class History extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent associated with the history.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\IgdbCompany.
|
||||
@@ -41,11 +42,11 @@ class IgdbCompany extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Belongs to many games.
|
||||
* Get the games that belong to the company.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<IgdbGame, $this>
|
||||
* @return BelongsToMany<IgdbGame, $this>
|
||||
*/
|
||||
public function games(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function games(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(IgdbGame::class);
|
||||
}
|
||||
|
||||
+10
-9
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\IgdbGame.
|
||||
@@ -56,31 +57,31 @@ class IgdbGame extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to many platforms.
|
||||
* Get the platforms that belong to the game.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<IgdbPlatform, $this>
|
||||
* @return BelongsToMany<IgdbPlatform, $this>
|
||||
*/
|
||||
public function platforms(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function platforms(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(IgdbPlatform::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to many companies.
|
||||
* Get the companies that belong to the game.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<IgdbCompany, $this>
|
||||
* @return BelongsToMany<IgdbCompany, $this>
|
||||
*/
|
||||
public function companies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function companies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(IgdbCompany::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to many genres.
|
||||
* Get the genres that belong to the game.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<IgdbGenre, $this>
|
||||
* @return BelongsToMany<IgdbGenre, $this>
|
||||
*/
|
||||
public function genres(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function genres(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(IgdbGenre::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\IgdbGenre.
|
||||
@@ -41,11 +42,11 @@ class IgdbGenre extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Belongs to many games.
|
||||
* Get the games that belong to the genre.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<IgdbGame, $this>
|
||||
* @return BelongsToMany<IgdbGame, $this>
|
||||
*/
|
||||
public function games(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function games(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(IgdbGame::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\IgdbPlatform.
|
||||
@@ -42,11 +43,11 @@ class IgdbPlatform extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Belongs to many games.
|
||||
* Get the games that belong to the platform.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<IgdbGame, $this>
|
||||
* @return BelongsToMany<IgdbGame, $this>
|
||||
*/
|
||||
public function games(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function games(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(IgdbGame::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\Internal.
|
||||
@@ -43,18 +44,18 @@ class Internal extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Has Many Users.
|
||||
* Get the users that belong to the internal group.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this, InternalUser>
|
||||
* @return BelongsToMany<User, $this, InternalUser>
|
||||
*/
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function users(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class)
|
||||
->using(InternalUser::class)
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
/**
|
||||
@@ -38,21 +39,21 @@ class InternalUser extends Pivot
|
||||
public $incrementing = true;
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* The user that is a member of the internal group.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to an internal.
|
||||
* The internal group the user is a member of.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Internal, $this>
|
||||
* @return BelongsTo<Internal, $this>
|
||||
*/
|
||||
public function internal(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function internal(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Internal::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
@@ -48,11 +49,11 @@ class Invite extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* The user that sent the invite.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function sender(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function sender(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id')->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -61,11 +62,11 @@ class Invite extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* The user that received the invite.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function receiver(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function receiver(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'accepted_by')->withDefault([
|
||||
'username' => 'System',
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\Keyword.
|
||||
@@ -43,18 +44,18 @@ class Keyword extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Belongs To Many Torrents.
|
||||
* Get the torrents that have this keyword.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Torrent, $this>
|
||||
* @return BelongsToMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function torrents(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Torrent::class);
|
||||
}
|
||||
|
||||
+7
-6
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Like.
|
||||
@@ -59,11 +60,11 @@ class Like extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that liked.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -72,11 +73,11 @@ class Like extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Post.
|
||||
* Get the post that was liked.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Post, $this>
|
||||
* @return BelongsTo<Post, $this>
|
||||
*/
|
||||
public function post(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function post(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Post::class);
|
||||
}
|
||||
|
||||
+13
-12
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Message.
|
||||
@@ -50,41 +51,41 @@ class Message extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A Bot.
|
||||
* Get the bot that sent the message.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Bot, $this>
|
||||
* @return BelongsTo<Bot, $this>
|
||||
*/
|
||||
public function bot(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function bot(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Bot::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that sent the message.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* A message belongs to a receiver.
|
||||
* Get the user that received the message.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function receiver(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function receiver(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'receiver_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Chat Room.
|
||||
* Get the chatroom the message was sent in.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Chatroom, $this>
|
||||
* @return BelongsTo<Chatroom, $this>
|
||||
*/
|
||||
public function chatroom(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function chatroom(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Chatroom::class);
|
||||
}
|
||||
|
||||
+8
-7
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Note.
|
||||
@@ -38,7 +39,7 @@ class Note extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -52,11 +53,11 @@ class Note extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that was noted.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function noteduser(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function noteduser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id')->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -65,11 +66,11 @@ class Note extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the staff user wrote the note.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function staffuser(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function staffuser(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'staff_id')->withDefault([
|
||||
'username' => 'System',
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Occupation.
|
||||
@@ -35,24 +37,28 @@ class Occupation extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
|
||||
* Get the the people that belong to the occupation.
|
||||
*
|
||||
* @return BelongsToMany<TmdbPerson, $this>
|
||||
*/
|
||||
public function people(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function people(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbPerson::class, 'tmdb_credits');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TmdbCredit, $this>
|
||||
* Get all the credits for this occupation.
|
||||
*
|
||||
* @return HasMany<TmdbCredit, $this>
|
||||
*/
|
||||
public function credits(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function credits(): HasMany
|
||||
{
|
||||
return $this->hasMany(TmdbCredit::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Option.
|
||||
@@ -47,11 +48,11 @@ class Option extends Model
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A Poll.
|
||||
* Get the poll that owns the option.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Poll, $this>
|
||||
* @return BelongsTo<Poll, $this>
|
||||
*/
|
||||
public function poll(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function poll(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Poll::class);
|
||||
}
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ class Page extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Set The Pages Content After Its Been Purified.
|
||||
* Set the pages content after it has been purified.
|
||||
*/
|
||||
public function setContentAttribute(?string $value): void
|
||||
{
|
||||
@@ -54,7 +54,7 @@ class Page extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse Content And Return Valid HTML.
|
||||
* Parse content and return valid HTML.
|
||||
*/
|
||||
public function getContentHtml(): string
|
||||
{
|
||||
|
||||
@@ -17,6 +17,8 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Participant extends Model
|
||||
@@ -31,31 +33,31 @@ class Participant extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the user associated the participant.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the conversation associated with the participant.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Conversation, $this>
|
||||
* @return BelongsTo<Conversation, $this>
|
||||
*/
|
||||
public function conversation(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function conversation(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Conversation::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has many messages in the conversation.
|
||||
* Get all of the messages for this participant.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<PrivateMessage, $this>
|
||||
* @return HasMany<PrivateMessage, $this>
|
||||
*/
|
||||
public function messages(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function messages(): HasMany
|
||||
{
|
||||
return $this->hasMany(PrivateMessage::class, 'conversation_id', 'conversation_id');
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Passkey.
|
||||
@@ -30,7 +31,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Passkey extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -56,11 +57,11 @@ class Passkey extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get the user that owns this passkey.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -5,11 +5,12 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PasswordResetHistory extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -35,11 +36,11 @@ class PasswordResetHistory extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get the user that owns the password reset history.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
+10
-9
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Peer.
|
||||
@@ -67,11 +68,11 @@ class Peer extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user associated with the peer.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -80,21 +81,21 @@ class Peer extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent associated with the peer.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Seed.
|
||||
* Get the torrent associated with the peer.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function seed(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function seed(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class, 'torrents.id', 'torrent_id');
|
||||
}
|
||||
|
||||
+20
-14
@@ -19,6 +19,10 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
/**
|
||||
* App\Models\Playlist.
|
||||
@@ -46,11 +50,11 @@ class Playlist extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the playlist.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -59,39 +63,41 @@ class Playlist extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a Category.
|
||||
* Get the category for the playlist.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<PlaylistCategory, $this>
|
||||
* @return BelongsTo<PlaylistCategory, $this>
|
||||
*/
|
||||
public function playlistCategory(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function playlistCategory(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PlaylistCategory::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get the torrents that belong to the playlist.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Torrent, $this, PlaylistTorrent>
|
||||
* @return BelongsToMany<Torrent, $this, PlaylistTorrent>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function torrents(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Torrent::class, 'playlist_torrents')->using(PlaylistTorrent::class)->withPivot('id')->withTimestamps();
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get the suggestions for this playlist.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<PlaylistSuggestion, $this>
|
||||
* @return HasMany<PlaylistSuggestion, $this>
|
||||
*/
|
||||
public function suggestions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function suggestions(): HasMany
|
||||
{
|
||||
return $this->hasMany(PlaylistSuggestion::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<Comment, $this>
|
||||
* Get the comments for this playlist.
|
||||
*
|
||||
* @return MorphMany<Comment, $this>
|
||||
*/
|
||||
public function comments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function comments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Comment::class, 'commentable');
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\PlaylistCategory.
|
||||
@@ -50,11 +51,11 @@ class PlaylistCategory extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Has many playlists.
|
||||
* Get the playlists for this category.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Playlist, $this>
|
||||
* @return HasMany<Playlist, $this>
|
||||
*/
|
||||
public function playlists(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function playlists(): HasMany
|
||||
{
|
||||
return $this->hasMany(Playlist::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\PlaylistSuggestion.
|
||||
@@ -42,31 +43,31 @@ class PlaylistSuggestion extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs to a torrent.
|
||||
* Get the torrent associated with the playlist suggestion.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a User.
|
||||
* Get the user associated with the playlist suggestion.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a playlist.
|
||||
* Get the playlist associated with the suggestion.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Playlist, $this>
|
||||
* @return BelongsTo<Playlist, $this>
|
||||
*/
|
||||
public function playlist(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function playlist(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Playlist::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
/**
|
||||
@@ -53,21 +54,21 @@ class PlaylistTorrent extends Pivot
|
||||
protected $table = 'playlist_torrents';
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent associated with the playlist.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Playlist.
|
||||
* Get the playlist associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Playlist, $this>
|
||||
* @return BelongsTo<Playlist, $this>
|
||||
*/
|
||||
public function playlist(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function playlist(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Playlist::class);
|
||||
}
|
||||
|
||||
+16
-13
@@ -19,6 +19,9 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Poll.
|
||||
@@ -58,11 +61,11 @@ class Poll extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that created the poll.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -71,37 +74,37 @@ class Poll extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* A Poll Has Many Options.
|
||||
* Get all options for the poll.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Option, $this>
|
||||
* @return HasMany<Option, $this>
|
||||
*/
|
||||
public function options(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function options(): HasMany
|
||||
{
|
||||
return $this->hasMany(Option::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Poll Has Many Voters.
|
||||
* Get all the users that voted on the poll.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
|
||||
* @return BelongsToMany<User, $this>
|
||||
*/
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function users(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'voters')->withTimestamps();
|
||||
}
|
||||
|
||||
/**
|
||||
* A Poll Has Many Votes.
|
||||
* Geth all the votes for the poll.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Voter, $this>
|
||||
* @return HasMany<Voter, $this>
|
||||
*/
|
||||
public function votes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function votes(): HasMany
|
||||
{
|
||||
return $this->hasMany(Voter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set The Poll's Title.
|
||||
* Set the poll's title.
|
||||
*/
|
||||
public function setTitleAttribute(string $title): void
|
||||
{
|
||||
|
||||
+23
-21
@@ -19,6 +19,8 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Post.
|
||||
@@ -63,21 +65,21 @@ class Post extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Topic.
|
||||
* Get the topic that owns the post.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Topic, $this>
|
||||
* @return BelongsTo<Topic, $this>
|
||||
*/
|
||||
public function topic(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function topic(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Topic::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that wrote the post.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -86,51 +88,51 @@ class Post extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* A Post Has Many Likes.
|
||||
* Get all likes for the post.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Like, $this>
|
||||
* @return HasMany<Like, $this>
|
||||
*/
|
||||
public function likes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function likes(): HasMany
|
||||
{
|
||||
return $this->hasMany(Like::class)->where('like', '=', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Post Has Many Dislikes.
|
||||
* Get all dislikes for the post.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Like, $this>
|
||||
* @return HasMany<Like, $this>
|
||||
*/
|
||||
public function dislikes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function dislikes(): HasMany
|
||||
{
|
||||
return $this->hasMany(Like::class)->where('dislike', '=', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Tips.
|
||||
* Get all tips for the post.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<PostTip, $this>
|
||||
* @return HasMany<PostTip, $this>
|
||||
*/
|
||||
public function tips(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function tips(): HasMany
|
||||
{
|
||||
return $this->hasMany(PostTip::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Post Author Has Many Posts.
|
||||
* Get all the posts for the post's author.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Post, $this>
|
||||
* @return HasMany<Post, $this>
|
||||
*/
|
||||
public function authorPosts(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function authorPosts(): HasMany
|
||||
{
|
||||
return $this->hasMany(Post::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* A Post Author Has Many Topics.
|
||||
* Get all the topics for the post's author.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Topic, $this>
|
||||
* @return HasMany<Topic, $this>
|
||||
*/
|
||||
public function authorTopics(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function authorTopics(): HasMany
|
||||
{
|
||||
return $this->hasMany(Topic::class, 'first_post_user_id', 'user_id');
|
||||
}
|
||||
|
||||
+13
-6
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Gift.
|
||||
@@ -47,25 +48,31 @@ class PostTip extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that sent the post tip.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function sender(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function sender(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that received the post tip.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function recipient(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function recipient(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Post, $this>
|
||||
* Get the post associated with the post tip.
|
||||
*
|
||||
* @return BelongsTo<Post, $this>
|
||||
*/
|
||||
public function post(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function post(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Post::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\PrivateMessage.
|
||||
@@ -42,21 +43,21 @@ class PrivateMessage extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user who sent the private message.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function sender(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function sender(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'sender_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Conversation.
|
||||
* Get the conversation associated with the private message.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Conversation, $this>
|
||||
* @return BelongsTo<Conversation, $this>
|
||||
*/
|
||||
public function conversation(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function conversation(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Conversation::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Prize.
|
||||
@@ -40,11 +41,11 @@ class Prize extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs to a prize.
|
||||
* Get the event that owns the prize.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Event, $this>
|
||||
* @return BelongsTo<Event, $this>
|
||||
*/
|
||||
public function event(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function event(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Event::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Region.
|
||||
@@ -35,7 +36,7 @@ class Region extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -49,21 +50,21 @@ class Region extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get all torrents for the region.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Torrent, $this>
|
||||
* @return HasMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function torrents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrent Requests.
|
||||
* Get all requests for the region.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequest, $this>
|
||||
* @return HasMany<TorrentRequest, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function requests(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequest::class);
|
||||
}
|
||||
|
||||
+16
-15
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Report.
|
||||
@@ -66,51 +67,51 @@ class Report extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Request.
|
||||
* Get the request that was reported.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TorrentRequest, $this>
|
||||
* @return BelongsTo<TorrentRequest, $this>
|
||||
*/
|
||||
public function request(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function request(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TorrentRequest::class, 'request_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent that was reported.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class, 'torrent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that reported.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function reporter(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function reporter(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'reporter_id')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that was reported.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function reported(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function reported(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'reported_user')->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Staff Member.
|
||||
* Get the staff user that solved the report.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function staff(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function staff(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'staff_id')->withTrashed();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Resolution.
|
||||
@@ -35,7 +36,7 @@ class Resolution extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -49,21 +50,21 @@ class Resolution extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get all torrents for the resolution.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Torrent, $this>
|
||||
* @return HasMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function torrents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrent Requests.
|
||||
* Get all requests for the resolution.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequest, $this>
|
||||
* @return HasMany<TorrentRequest, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function requests(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequest::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Resurrection.
|
||||
@@ -58,21 +59,21 @@ class Resurrection extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user who owns the resurrection.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent that was resurrected.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
+8
-7
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use stdClass;
|
||||
|
||||
@@ -45,7 +46,7 @@ class Rss extends Model
|
||||
use SoftDeletes;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
* The table associated with the mode.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -74,11 +75,11 @@ class Rss extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the rss feed.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -87,11 +88,11 @@ class Rss extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Staff Member.
|
||||
* Get the staff user that created the rss feed.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function staff(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function staff(): BelongsTo
|
||||
{
|
||||
// Not needed yet. Just added for future extendability.
|
||||
return $this->belongsTo(User::class, 'staff_id');
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Rsskey.
|
||||
@@ -30,7 +31,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Rsskey extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -56,11 +57,11 @@ class Rsskey extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the user that owns the rss key.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ use App\Traits\Auditable;
|
||||
use App\Traits\Encryptable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Seedbox.
|
||||
@@ -40,7 +41,7 @@ class Seedbox extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Attributes That Are Encrypted.
|
||||
* The attributes that are encrypted.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
@@ -51,11 +52,11 @@ class Seedbox extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the seedbox.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
|
||||
+12
-11
@@ -20,6 +20,7 @@ use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Subscription.
|
||||
@@ -39,11 +40,11 @@ class Subscription extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the subscription.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -52,27 +53,27 @@ class Subscription extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Topic.
|
||||
* Gets the subscribed topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Topic, $this>
|
||||
* @return BelongsTo<Topic, $this>
|
||||
*/
|
||||
public function topic(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function topic(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Topic::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Forum.
|
||||
* Gets the subscribed forum.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Forum, $this>
|
||||
* @return BelongsTo<Forum, $this>
|
||||
*/
|
||||
public function forum(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function forum(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Forum::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Only include subscriptions of a forum.
|
||||
* Scope query to only include subscriptions of a forum.
|
||||
*
|
||||
* @param Builder<Subscription> $query
|
||||
* @return Builder<Subscription>
|
||||
@@ -83,7 +84,7 @@ class Subscription extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Only include subscriptions of a topic.
|
||||
* Scope query to only include subscriptions of a topic.
|
||||
*
|
||||
* @param Builder<Subscription> $query
|
||||
* @return Builder<Subscription>
|
||||
|
||||
+11
-10
@@ -22,6 +22,7 @@ use App\Helpers\StringHelper;
|
||||
use App\Models\Scopes\ApprovedScope;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Subtitle.
|
||||
@@ -73,11 +74,11 @@ class Subtitle extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that uploaded the subtitle.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -86,27 +87,27 @@ class Subtitle extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent associated with the subtitle.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Media Language.
|
||||
* Get the language associated with the subtitle.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<MediaLanguage, $this>
|
||||
* @return BelongsTo<MediaLanguage, $this>
|
||||
*/
|
||||
public function language(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function language(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(MediaLanguage::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns The Size In Human Format.
|
||||
* Gets the size in human format.
|
||||
*/
|
||||
public function getSize(): string
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Thank.
|
||||
@@ -39,21 +40,21 @@ class Thank extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent that was thanked.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that thanked.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
+25
-20
@@ -19,6 +19,9 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
/**
|
||||
* App\Models\Ticket.
|
||||
@@ -63,11 +66,11 @@ class Ticket extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User (Created).
|
||||
* Get the user who created the ticket.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -76,59 +79,61 @@ class Ticket extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Staff User (Assigned).
|
||||
* Get the staff user that was assigned the ticket.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function staff(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function staff(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'staff_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Ticket Priority.
|
||||
* Get the priority associated with the ticket.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TicketPriority, $this>
|
||||
* @return BelongsTo<TicketPriority, $this>
|
||||
*/
|
||||
public function priority(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function priority(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TicketPriority::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Ticket Category.
|
||||
* Get the category associated with the ticket.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TicketCategory, $this>
|
||||
* @return BelongsTo<TicketCategory, $this>
|
||||
*/
|
||||
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TicketCategory::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Ticket Attachments.
|
||||
* Get all attachments for the ticket.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TicketAttachment, $this>
|
||||
* @return HasMany<TicketAttachment, $this>
|
||||
*/
|
||||
public function attachments(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function attachments(): HasMany
|
||||
{
|
||||
return $this->hasMany(TicketAttachment::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<Comment, $this>
|
||||
* Get the comments for the ticket.
|
||||
*
|
||||
* @return MorphMany<Comment, $this>
|
||||
*/
|
||||
public function comments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function comments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Comment::class, 'commentable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Ticket Notes.
|
||||
* Get the notes for the ticket.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TicketNote, $this>
|
||||
* @return HasMany<TicketNote, $this>
|
||||
*/
|
||||
public function notes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function notes(): HasMany
|
||||
{
|
||||
return $this->hasMany(TicketNote::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TicketAttachment.
|
||||
@@ -41,21 +42,21 @@ class TicketAttachment extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user who uploaded the ticket attachment.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Ticket.
|
||||
* Get the ticket associated with the attachment.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Ticket, $this>
|
||||
* @return BelongsTo<Ticket, $this>
|
||||
*/
|
||||
public function ticket(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function ticket(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Ticket::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TicketNote.
|
||||
@@ -38,21 +39,21 @@ class TicketNote extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that wrote the note.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Ticket.
|
||||
* Get the ticket associated with the note.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Ticket, $this>
|
||||
* @return BelongsTo<Ticket, $this>
|
||||
*/
|
||||
public function ticket(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function ticket(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Ticket::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbCollection.
|
||||
@@ -42,17 +44,21 @@ class TmdbCollection extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<Comment, $this>
|
||||
* Get the comments for the collection.
|
||||
*
|
||||
* @return MorphMany<Comment, $this>
|
||||
*/
|
||||
public function comments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function comments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Comment::class, 'commentable');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this>
|
||||
* Get the movies that belong to the collection.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this>
|
||||
*/
|
||||
public function movies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function movies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbCompany.
|
||||
@@ -40,33 +41,41 @@ class TmdbCompany extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this>
|
||||
* Get the movies that belong to the company.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this>
|
||||
*/
|
||||
public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function movie(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this>
|
||||
* Get the tv shows that belong to the company.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this>
|
||||
*/
|
||||
public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function tv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Torrent, $this>
|
||||
* Get the movie torrents that belong to the company.
|
||||
*
|
||||
* @return BelongsToMany<Torrent, $this>
|
||||
*/
|
||||
public function movieTorrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function movieTorrents(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Torrent::class, 'tmdb_company_tmdb_movie', 'tmdb_company_id', 'tmdb_movie_id', 'id', 'tmdb_movie_id')->whereRelation('category', 'movie_meta', '=', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Torrent, $this>
|
||||
* Get the tv torrents that belong to the company.
|
||||
*
|
||||
* @return BelongsToMany<Torrent, $this>
|
||||
*/
|
||||
public function tvTorrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function tvTorrents(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Torrent::class, 'tmdb_company_tmdb_tv', 'tmdb_company_id', 'tmdb_tv_id', 'id', 'tmdb_tv_id')->whereRelation('category', 'tv_meta', '=', true);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbCredit.
|
||||
@@ -36,40 +37,48 @@ class TmdbCredit extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Occupation, $this>
|
||||
* Get the occupation associated with the credit.
|
||||
*
|
||||
* @return BelongsTo<Occupation, $this>
|
||||
*/
|
||||
public function occupation(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function occupation(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Occupation::class, 'occupation_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TmdbPerson, $this>
|
||||
* Get the person associated with the credit.
|
||||
*
|
||||
* @return BelongsTo<TmdbPerson, $this>
|
||||
*/
|
||||
public function person(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function person(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TmdbPerson::class, 'tmdb_person_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TmdbTv, $this>
|
||||
* Get the tv show associated with the credit.
|
||||
*
|
||||
* @return BelongsTo<TmdbTv, $this>
|
||||
*/
|
||||
public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function tv(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TmdbTv::class, 'tmdb_tv_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TmdbMovie, $this>
|
||||
* Get the movie associated with the credit.
|
||||
*
|
||||
* @return BelongsTo<TmdbMovie, $this>
|
||||
*/
|
||||
public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function movie(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TmdbMovie::class, 'tmdb_movie_id');
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbGenre.
|
||||
@@ -35,17 +36,21 @@ class TmdbGenre extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this>
|
||||
* Get the movies that belong to the genre.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this>
|
||||
*/
|
||||
public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function movie(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this>
|
||||
* Get the tv shows that belong to the genre.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this>
|
||||
*/
|
||||
public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function tv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class);
|
||||
}
|
||||
|
||||
+46
-22
@@ -19,6 +19,8 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Enums\Occupation;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbMovie.
|
||||
@@ -68,42 +70,52 @@ class TmdbMovie extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbGenre, $this>
|
||||
* Get the genres that belong to the movie.
|
||||
*
|
||||
* @return BelongsToMany<TmdbGenre, $this>
|
||||
*/
|
||||
public function genres(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function genres(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbGenre::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
|
||||
* Get the people that belong to the movie.
|
||||
*
|
||||
* @return BelongsToMany<TmdbPerson, $this>
|
||||
*/
|
||||
public function people(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function people(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbPerson::class, 'tmdb_credits');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TmdbCredit, $this>
|
||||
* Get the credits for the movie.
|
||||
*
|
||||
* @return HasMany<TmdbCredit, $this>
|
||||
*/
|
||||
public function credits(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function credits(): HasMany
|
||||
{
|
||||
return $this->hasMany(TmdbCredit::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
|
||||
* Get the directors that belong to the movie.
|
||||
*
|
||||
* @return BelongsToMany<TmdbPerson, $this>
|
||||
*/
|
||||
public function directors(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function directors(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbPerson::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::DIRECTOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
|
||||
* Get the actors that belong to the movie.
|
||||
*
|
||||
* @return BelongsToMany<TmdbPerson, $this>
|
||||
*/
|
||||
public function actors(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function actors(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbPerson::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::ACTOR)
|
||||
@@ -111,49 +123,61 @@ class TmdbMovie extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbCompany, $this>
|
||||
* Get the companies that belong to the movie.
|
||||
*
|
||||
* @return BelongsToMany<TmdbCompany, $this>
|
||||
*/
|
||||
public function companies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function companies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbCompany::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbCollection, $this>
|
||||
* Get the collections that belong to the movie.
|
||||
*
|
||||
* @return BelongsToMany<TmdbCollection, $this>
|
||||
*/
|
||||
public function collections(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function collections(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbCollection::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this>
|
||||
* Get the recommended movies that belong to the movie.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this>
|
||||
*/
|
||||
public function recommendedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function recommendedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(__CLASS__, 'tmdb_recommended_movies', 'tmdb_movie_id', 'recommended_tmdb_movie_id', 'id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Torrent, $this>
|
||||
* Get the torrents for the movie.
|
||||
*
|
||||
* @return HasMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function torrents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Torrent::class)->whereRelation('category', 'movie_meta', '=', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequest, $this>
|
||||
* Get the requests for the movie.
|
||||
*
|
||||
* @return HasMany<TorrentRequest, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function requests(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequest::class)->whereRelation('category', 'movie_meta', '=', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Wish, $this>
|
||||
* Get the wishes for the movie.
|
||||
*
|
||||
* @return HasMany<Wish, $this>
|
||||
*/
|
||||
public function wishes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function wishes(): HasMany
|
||||
{
|
||||
return $this->hasMany(Wish::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbNetwork.
|
||||
@@ -40,25 +41,30 @@ class TmdbNetwork extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this>
|
||||
* Get the tv shows that belong to the network.
|
||||
* @return BelongsToMany<TmdbTv, $this>
|
||||
*/
|
||||
public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function tv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this>
|
||||
* Get the movies that belong to the network.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this>
|
||||
*/
|
||||
public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function movie(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Torrent, $this>
|
||||
* Get the tv torrents that belong to the network.
|
||||
*
|
||||
* @return BelongsToMany<Torrent, $this>
|
||||
*/
|
||||
public function tvTorrents(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function tvTorrents(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Torrent::class, 'tmdb_network_tmdb_tv', 'tmdb_network_id', 'tmdb_tv_id', 'id', 'tmdb_tv_id')->whereRelation('category', 'tv_meta', '=', true);
|
||||
}
|
||||
|
||||
+91
-44
@@ -19,6 +19,9 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Enums\Occupation;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbPerson.
|
||||
@@ -49,17 +52,21 @@ class TmdbPerson extends Model
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TmdbCredit, $this>
|
||||
* Get the credits for the person.
|
||||
*
|
||||
* @return HasMany<TmdbCredit, $this>
|
||||
*/
|
||||
public function credits(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function credits(): HasMany
|
||||
{
|
||||
return $this->hasMany(TmdbCredit::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows credited with the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function tv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->withPivot('character', 'occupation_id')
|
||||
@@ -67,9 +74,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows created by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function createdTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function createdTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::CREATOR)
|
||||
@@ -78,9 +87,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows directed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function directedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function directedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::DIRECTOR)
|
||||
@@ -89,9 +100,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows written by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function writtenTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function writtenTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::WRITER)
|
||||
@@ -100,9 +113,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows produced by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function producedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function producedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::PRODUCER)
|
||||
@@ -111,9 +126,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows composed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function composedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function composedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::COMPOSER)
|
||||
@@ -122,9 +139,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows cinematographed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function cinematographedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function cinematographedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::CINEMATOGRAPHER)
|
||||
@@ -133,9 +152,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows edited by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function editedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function editedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::EDITOR)
|
||||
@@ -144,9 +165,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows production designed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function productionDesignedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function productionDesignedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::PRODUCTION_DESIGNER)
|
||||
@@ -155,9 +178,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows art directed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function artDirectedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function artDirectedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::ART_DIRECTOR)
|
||||
@@ -166,9 +191,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the tv shows acted by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function actedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function actedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbTv::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::ACTOR)
|
||||
@@ -177,9 +204,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies credited with the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function movie(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->withPivot('character', 'occupation_id')
|
||||
@@ -187,9 +216,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies directed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function directedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function directedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::DIRECTOR)
|
||||
@@ -198,9 +229,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies written by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function writtenMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function writtenMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::WRITER)
|
||||
@@ -209,9 +242,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies produced by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function producedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function producedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::PRODUCER)
|
||||
@@ -220,9 +255,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies composed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function composedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function composedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::COMPOSER)
|
||||
@@ -231,9 +268,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies cinematographed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function cinematographedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function cinematographedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::CINEMATOGRAPHER)
|
||||
@@ -242,9 +281,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies edited by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function editedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function editedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::EDITOR)
|
||||
@@ -253,9 +294,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies production designed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function productionDesignedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function productionDesignedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::PRODUCTION_DESIGNER)
|
||||
@@ -264,9 +307,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies art directed by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function artDirectedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function artDirectedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::ART_DIRECTOR)
|
||||
@@ -275,9 +320,11 @@ class TmdbPerson extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbMovie, $this, \Illuminate\Database\Eloquent\Relations\Pivot, 'credit'>
|
||||
* Get the movies acted by the person.
|
||||
*
|
||||
* @return BelongsToMany<TmdbMovie, $this, Pivot, 'credit'>
|
||||
*/
|
||||
public function actedMovies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function actedMovies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbMovie::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::ACTOR)
|
||||
|
||||
+42
-21
@@ -19,6 +19,8 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use App\Enums\Occupation;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\TmdbTv.
|
||||
@@ -80,44 +82,52 @@ class TmdbTv extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get torrents for the tv show.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Torrent, $this>
|
||||
* @return HasMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function torrents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Torrent::class)->whereRelation('category', 'tv_meta', '=', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
|
||||
* Get the people that belong to the tv show.
|
||||
*
|
||||
* @return BelongsToMany<TmdbPerson, $this>
|
||||
*/
|
||||
public function people(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function people(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbPerson::class, 'tmdb_credits');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TmdbCredit, $this>
|
||||
* Get the credits for the tv show.
|
||||
*
|
||||
* @return HasMany<TmdbCredit, $this>
|
||||
*/
|
||||
public function credits(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function credits(): HasMany
|
||||
{
|
||||
return $this->hasMany(TmdbCredit::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
|
||||
* Get the creators that belong to the tv show.
|
||||
*
|
||||
* @return BelongsToMany<TmdbPerson, $this>
|
||||
*/
|
||||
public function creators(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function creators(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbPerson::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::CREATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbPerson, $this>
|
||||
* Get the actors that belong to the tv show.
|
||||
*
|
||||
* @return BelongsToMany<TmdbPerson, $this>
|
||||
*/
|
||||
public function actors(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function actors(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbPerson::class, 'tmdb_credits')
|
||||
->wherePivot('occupation_id', '=', Occupation::ACTOR)
|
||||
@@ -125,41 +135,52 @@ class TmdbTv extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbGenre, $this>
|
||||
* Get the genres that belong to the tv show.
|
||||
*
|
||||
* @return BelongsToMany<TmdbGenre, $this>
|
||||
*/
|
||||
public function genres(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function genres(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbGenre::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbNetwork, $this>
|
||||
* Get the networks that belong to the tv show.
|
||||
*
|
||||
* @return BelongsToMany<TmdbNetwork, $this>
|
||||
*/
|
||||
public function networks(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function networks(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbNetwork::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbCompany, $this>
|
||||
* Get the companies that belong to the tv show.
|
||||
*
|
||||
*
|
||||
* @return BelongsToMany<TmdbCompany, $this>
|
||||
*/
|
||||
public function companies(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function companies(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(TmdbCompany::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<TmdbTv, $this>
|
||||
* Get the recommended tv shows that belong to the tv show.
|
||||
*
|
||||
* @return BelongsToMany<TmdbTv, $this>
|
||||
*/
|
||||
public function recommendedTv(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function recommendedTv(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(__CLASS__, 'tmdb_recommended_tv', 'tmdb_tv_id', 'recommended_tmdb_tv_id', 'id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Wish, $this>
|
||||
* Get the wishes for this tv show.
|
||||
*
|
||||
* @return HasMany<Wish, $this>
|
||||
*/
|
||||
public function wishes(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function wishes(): HasMany
|
||||
{
|
||||
return $this->hasMany(Wish::class);
|
||||
}
|
||||
|
||||
+35
-31
@@ -19,6 +19,10 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
/**
|
||||
* App\Models\Topic.
|
||||
@@ -74,107 +78,107 @@ class Topic extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Forum.
|
||||
* Get the forum that owns the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Forum, $this>
|
||||
* @return BelongsTo<Forum, $this>
|
||||
*/
|
||||
public function forum(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function forum(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Forum::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user who started the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'first_post_user_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Posts.
|
||||
* Get the posts for the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Post, $this>
|
||||
* @return HasMany<Post, $this>
|
||||
*/
|
||||
public function posts(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function posts(): HasMany
|
||||
{
|
||||
return $this->hasMany(Post::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Posts.
|
||||
* Get the reads of the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TopicRead, $this>
|
||||
* @return HasMany<TopicRead, $this>
|
||||
*/
|
||||
public function reads(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function reads(): HasMany
|
||||
{
|
||||
return $this->hasMany(TopicRead::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Subscriptions.
|
||||
* Get the subscriptions of the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Subscription, $this>
|
||||
* @return HasMany<Subscription, $this>
|
||||
*/
|
||||
public function subscriptions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function subscriptions(): HasMany
|
||||
{
|
||||
return $this->hasMany(Subscription::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has One Permissions through Forum.
|
||||
* Get the forum permissions of the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<ForumPermission, $this>
|
||||
* @return HasMany<ForumPermission, $this>
|
||||
*/
|
||||
public function forumPermissions(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function forumPermissions(): HasMany
|
||||
{
|
||||
return $this->hasMany(ForumPermission::class, 'forum_id', 'forum_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to Many Subscribed Users.
|
||||
* Get the users subscribed to the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<User, $this>
|
||||
* @return BelongsToMany<User, $this>
|
||||
*/
|
||||
public function subscribedUsers(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function subscribedUsers(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, Subscription::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest post.
|
||||
* Get the latest post for the topic.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<Post, $this>
|
||||
* @return HasOne<Post, $this>
|
||||
*/
|
||||
public function latestPostSlow(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
public function latestPostSlow(): HasOne
|
||||
{
|
||||
return $this->hasOne(Post::class)->latestOfMany();
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest post.
|
||||
* Get the latest post for the topic (cached).
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Post, $this>
|
||||
* @return BelongsTo<Post, $this>
|
||||
*/
|
||||
public function latestPost(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function latestPost(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Post::class, 'last_post_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Latest poster.
|
||||
* Get the latest poster for the topic (cached).
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function latestPoster(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function latestPoster(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'last_post_user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Only include topics a user is authorized to.
|
||||
* Scope query to only include topics a user is authorized to.
|
||||
*
|
||||
* @param \Illuminate\Database\Eloquent\Builder<self> $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder<self>
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TopicRead.
|
||||
@@ -30,32 +31,38 @@ class TopicRead extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Topic, $this>
|
||||
* Get the topic that was read.
|
||||
*
|
||||
* @return BelongsTo<Topic, $this>
|
||||
*/
|
||||
public function topic(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function topic(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Topic::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that read the topic.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Post, $this>
|
||||
* Get the last post that the user read on the topic.
|
||||
*
|
||||
* @return BelongsTo<Post, $this>
|
||||
*/
|
||||
public function lastReadPost(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function lastReadPost(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Post::class);
|
||||
}
|
||||
|
||||
+98
-91
@@ -24,6 +24,11 @@ use App\Traits\GroupedLastScope;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Laravel\Scout\Searchable;
|
||||
|
||||
@@ -479,11 +484,11 @@ class Torrent extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that uploaded the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -492,101 +497,101 @@ class Torrent extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Category.
|
||||
* Get the category associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Category, $this>
|
||||
* @return BelongsTo<Category, $this>
|
||||
*/
|
||||
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Type.
|
||||
* Get the type associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Type, $this>
|
||||
* @return BelongsTo<Type, $this>
|
||||
*/
|
||||
public function type(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function type(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Type::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Resolution.
|
||||
* Get the resolution associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Resolution, $this>
|
||||
* @return BelongsTo<Resolution, $this>
|
||||
*/
|
||||
public function resolution(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function resolution(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Resolution::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Distributor.
|
||||
* Get the distributor associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Distributor, $this>
|
||||
* @return BelongsTo<Distributor, $this>
|
||||
*/
|
||||
public function distributor(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function distributor(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Distributor::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Region.
|
||||
* Get the region associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Region, $this>
|
||||
* @return BelongsTo<Region, $this>
|
||||
*/
|
||||
public function region(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function region(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Region::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Movie.
|
||||
* Get the movie associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TmdbMovie, $this>
|
||||
* @return BelongsTo<TmdbMovie, $this>
|
||||
*/
|
||||
public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function movie(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TmdbMovie::class, 'tmdb_movie_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Tv.
|
||||
* Get the tv show associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TmdbTv, $this>
|
||||
* @return BelongsTo<TmdbTv, $this>
|
||||
*/
|
||||
public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function tv(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TmdbTv::class, 'tmdb_tv_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Game.
|
||||
* Get the game associated with the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<IgdbGame, $this>
|
||||
* @return BelongsTo<IgdbGame, $this>
|
||||
*/
|
||||
public function game(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function game(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(IgdbGame::class, 'igdb_game_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Playlist.
|
||||
* Get the playlists that belong to the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<Playlist, $this, PlaylistTorrent>
|
||||
* @return BelongsToMany<Playlist, $this, PlaylistTorrent>
|
||||
*/
|
||||
public function playlists(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function playlists(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Playlist::class, 'playlist_torrents')->using(PlaylistTorrent::class)->withPivot('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Torrent Has Been Moderated By.
|
||||
* Get the staff user that moderated the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function moderated(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function moderated(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'moderated_by')->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -595,195 +600,197 @@ class Torrent extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Keywords.
|
||||
* Get the keywords for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Keyword, $this>
|
||||
* @return HasMany<Keyword, $this>
|
||||
*/
|
||||
public function keywords(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function keywords(): HasMany
|
||||
{
|
||||
return $this->hasMany(Keyword::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many History.
|
||||
* Get the history for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<History, $this>
|
||||
* @return HasMany<History, $this>
|
||||
*/
|
||||
public function history(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function history(): HasMany
|
||||
{
|
||||
return $this->hasMany(History::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Tips.
|
||||
* Get the tips for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentTip, $this>
|
||||
* @return HasMany<TorrentTip, $this>
|
||||
*/
|
||||
public function tips(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function tips(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentTip::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Thank.
|
||||
* Get the thanks for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Thank, $this>
|
||||
* @return HasMany<Thank, $this>
|
||||
*/
|
||||
public function thanks(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function thanks(): HasMany
|
||||
{
|
||||
return $this->hasMany(Thank::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many HitRuns.
|
||||
* Get the warnings for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Warning, $this>
|
||||
* @return HasMany<Warning, $this>
|
||||
*/
|
||||
public function hitrun(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function hitrun(): HasMany
|
||||
{
|
||||
return $this->hasMany(Warning::class, 'torrent');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Featured.
|
||||
* Get the features for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<FeaturedTorrent, $this>
|
||||
* @return HasMany<FeaturedTorrent, $this>
|
||||
*/
|
||||
public function featured(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function featured(): HasMany
|
||||
{
|
||||
return $this->hasMany(FeaturedTorrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Files.
|
||||
* Get the files for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentFile, $this>
|
||||
* @return HasMany<TorrentFile, $this>
|
||||
*/
|
||||
public function files(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function files(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentFile::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<Comment, $this>
|
||||
* Get the comments for the torrent.
|
||||
*
|
||||
* @return MorphMany<Comment, $this>
|
||||
*/
|
||||
public function comments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function comments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Comment::class, 'commentable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Peers.
|
||||
* Get the peers for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Peer, $this>
|
||||
* @return HasMany<Peer, $this>
|
||||
*/
|
||||
public function peers(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function peers(): HasMany
|
||||
{
|
||||
return $this->hasMany(Peer::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Seeds.
|
||||
* Get the seeds for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Peer, $this>
|
||||
* @return HasMany<Peer, $this>
|
||||
*/
|
||||
public function seeds(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function seeds(): HasMany
|
||||
{
|
||||
return $this->hasMany(Peer::class)->where('seeder', '=', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Leeches.
|
||||
* Get the leeches for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Peer, $this>
|
||||
* @return HasMany<Peer, $this>
|
||||
*/
|
||||
public function leeches(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function leeches(): HasMany
|
||||
{
|
||||
return $this->hasMany(Peer::class)->where('seeder', '=', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Subtitles.
|
||||
* Get the subtitles for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Subtitle, $this>
|
||||
* @return HasMany<Subtitle, $this>
|
||||
*/
|
||||
public function subtitles(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function subtitles(): HasMany
|
||||
{
|
||||
return $this->hasMany(Subtitle::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Relationship To Many Requests.
|
||||
* Get the requests for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequest, $this>
|
||||
* @return HasMany<TorrentRequest, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function requests(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequest::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has many free leech tokens.
|
||||
* Get the freeleech tokens for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<FreeleechToken, $this>
|
||||
* @return HasMany<FreeleechToken, $this>
|
||||
*/
|
||||
public function freeleechTokens(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function freeleechTokens(): HasMany
|
||||
{
|
||||
return $this->hasMany(FreeleechToken::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bookmarks.
|
||||
* Get the bookmarks for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Bookmark, $this>
|
||||
* @return HasMany<Bookmark, $this>
|
||||
*/
|
||||
public function bookmarks(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function bookmarks(): HasMany
|
||||
{
|
||||
return $this->hasMany(Bookmark::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resurrections.
|
||||
* Get the resurrections for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Resurrection, $this>
|
||||
* @return HasMany<Resurrection, $this>
|
||||
*/
|
||||
public function resurrections(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function resurrections(): HasMany
|
||||
{
|
||||
return $this->hasMany(Resurrection::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports.
|
||||
* Get the reports for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Report, $this>
|
||||
* @return HasMany<Report, $this>
|
||||
*/
|
||||
public function reports(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function reports(): HasMany
|
||||
{
|
||||
return $this->hasMany(Report::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Downloads.
|
||||
* Get the downloads for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentDownload, $this>
|
||||
* @return HasMany<TorrentDownload, $this>
|
||||
*/
|
||||
public function downloads(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function downloads(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentDownload::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Trump.
|
||||
* Get the trumps for the torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<TorrentTrump, $this>
|
||||
* @return HasOne<TorrentTrump, $this>
|
||||
*/
|
||||
public function trump(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
public function trump(): HasOne
|
||||
{
|
||||
return $this->hasOne(TorrentTrump::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set The Torrents MediaInfo After Its Been Purified.
|
||||
* Set the torrent's mediainfo after it's been purified.
|
||||
*/
|
||||
public function setMediaInfoAttribute(?string $value): void
|
||||
{
|
||||
@@ -791,7 +798,7 @@ class Torrent extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns The Size In Human Format.
|
||||
* Get the size in human format.
|
||||
*/
|
||||
public function getSize(): string
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TorrentDownload.
|
||||
@@ -35,11 +36,11 @@ class TorrentDownload extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the download.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -48,11 +49,11 @@ class TorrentDownload extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent associated with the download.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Helpers\StringHelper;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TorrentFile.
|
||||
@@ -34,31 +35,30 @@ class TorrentFile extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
*
|
||||
* The table associated with the model.
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'files';
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* The torrent that owns the file.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Size In Human Format.
|
||||
* Get size in human format.
|
||||
*/
|
||||
public function getSize(): string
|
||||
{
|
||||
|
||||
@@ -19,6 +19,10 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
/**
|
||||
* App\Models\TorrentRequest.
|
||||
@@ -57,7 +61,7 @@ class TorrentRequest extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -97,11 +101,11 @@ class TorrentRequest extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -110,11 +114,11 @@ class TorrentRequest extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the approver of the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function approver(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function approver(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'approved_by')->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -123,11 +127,11 @@ class TorrentRequest extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the filler of the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function filler(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function filler(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'filled_by')->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -136,99 +140,101 @@ class TorrentRequest extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Category.
|
||||
* Get the category associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Category, $this>
|
||||
* @return BelongsTo<Category, $this>
|
||||
*/
|
||||
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Category::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Type.
|
||||
* Get the type associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Type, $this>
|
||||
* @return BelongsTo<Type, $this>
|
||||
*/
|
||||
public function type(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function type(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Type::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Resolution.
|
||||
* Get the resolution associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Resolution, $this>
|
||||
* @return BelongsTo<Resolution, $this>
|
||||
*/
|
||||
public function resolution(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function resolution(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Resolution::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent that filled the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Movie.
|
||||
* Get the movie associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TmdbMovie, $this>
|
||||
* @return BelongsTo<TmdbMovie, $this>
|
||||
*/
|
||||
public function movie(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function movie(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TmdbMovie::class, 'tmdb_movie_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Tv.
|
||||
* Get the tv associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TmdbTv, $this>
|
||||
* @return BelongsTo<TmdbTv, $this>
|
||||
*/
|
||||
public function tv(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function tv(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TmdbTv::class, 'tmdb_tv_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Game.
|
||||
* Get the game associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<IgdbGame, $this>
|
||||
* @return BelongsTo<IgdbGame, $this>
|
||||
*/
|
||||
public function game(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function game(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(IgdbGame::class, 'igdb_game_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<Comment, $this>
|
||||
* Get the comments for the request.
|
||||
*
|
||||
* @return MorphMany<Comment, $this>
|
||||
*/
|
||||
public function comments(): \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||
public function comments(): MorphMany
|
||||
{
|
||||
return $this->morphMany(Comment::class, 'commentable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many BON Bounties.
|
||||
* Get the bounties for the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequestBounty, $this>
|
||||
* @return HasMany<TorrentRequestBounty, $this>
|
||||
*/
|
||||
public function bounties(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function bounties(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequestBounty::class, 'requests_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Has One Torrent Request Claim.
|
||||
* Get the claim associated with the request.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne<TorrentRequestClaim, $this>
|
||||
* @return HasOne<TorrentRequestClaim, $this>
|
||||
*/
|
||||
public function claim(): \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
public function claim(): HasOne
|
||||
{
|
||||
return $this->hasOne(TorrentRequestClaim::class, 'request_id');
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TorrentRequestBounty.
|
||||
@@ -39,7 +40,7 @@ class TorrentRequestBounty extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -66,11 +67,11 @@ class TorrentRequestBounty extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that added the bounty.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
@@ -79,11 +80,11 @@ class TorrentRequestBounty extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent Request.
|
||||
* Get the request that the bounty was added to.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<TorrentRequest, $this>
|
||||
* @return BelongsTo<TorrentRequest, $this>
|
||||
*/
|
||||
public function request(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function request(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TorrentRequest::class, 'requests_id');
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class TorrentRequestClaim extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The Database Table Used By The Model.
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ class TorrentRequestClaim extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that claimed the request.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
@@ -75,6 +75,7 @@ class TorrentRequestClaim extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the request that the user claimed.
|
||||
* @return BelongsTo<TorrentRequest, $this>
|
||||
*/
|
||||
public function request(): BelongsTo
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TorrentReseed.
|
||||
@@ -41,31 +42,31 @@ class TorrentReseed extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent that was requested to be reseeded.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that requested the reseed.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A History.
|
||||
* Get the history associated with the same user and torrent.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<History, $this>
|
||||
* @return BelongsTo<History, $this>
|
||||
*/
|
||||
public function history(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function history(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(History::class, 'user_id', 'user_id')->whereColumn('torrent_reseeds.torrent_id', '=', 'history.torrent_id');
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Gift.
|
||||
@@ -47,25 +48,31 @@ class TorrentTip extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that sent the tip.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function sender(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function sender(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that received the tip.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function recipient(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function recipient(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* Get the torrent that was tipped on.
|
||||
*
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use App\Models\Scopes\ApprovedScope;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TorrentTrump.
|
||||
@@ -39,17 +40,21 @@ class TorrentTrump extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* Get the torrent that can be trumped.
|
||||
*
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class)->withoutGlobalScope(ApprovedScope::class)->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* Get the user that created the trump message.
|
||||
*
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class)->with('group')->withTrashed();
|
||||
}
|
||||
|
||||
+8
-7
@@ -19,6 +19,7 @@ namespace App\Models;
|
||||
use App\Traits\Auditable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* App\Models\Type.
|
||||
@@ -35,7 +36,7 @@ class Type extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -49,21 +50,21 @@ class Type extends Model
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* Has Many Torrents.
|
||||
* Get the torrents for the type.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<Torrent, $this>
|
||||
* @return HasMany<Torrent, $this>
|
||||
*/
|
||||
public function torrents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function torrents(): HasMany
|
||||
{
|
||||
return $this->hasMany(Torrent::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Torrent Requests.
|
||||
* Get the requests for the type.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany<TorrentRequest, $this>
|
||||
* @return HasMany<TorrentRequest, $this>
|
||||
*/
|
||||
public function requests(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function requests(): HasMany
|
||||
{
|
||||
return $this->hasMany(TorrentRequest::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\UnreadArticle.
|
||||
@@ -42,21 +43,21 @@ class UnreadArticle extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs to an article.
|
||||
* Get the article that is unread.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Article, $this>
|
||||
* @return BelongsTo<Article, $this>
|
||||
*/
|
||||
public function article(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function article(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Article::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs to a user.
|
||||
* Get the user that hasn't read the article.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ declare(strict_types=1);
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\Note.
|
||||
@@ -36,21 +37,21 @@ class UnregisteredInfoHash extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that announced the unregistered info hash.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Torrent.
|
||||
* Get the torrent matching the unregistered info hash.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
|
||||
* @return BelongsTo<Torrent, $this>
|
||||
*/
|
||||
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function torrent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Torrent::class, 'info_hash', 'info_hash');
|
||||
}
|
||||
|
||||
+258
-248
File diff suppressed because it is too large
Load Diff
+13
-12
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\UserAudible.
|
||||
@@ -44,41 +45,41 @@ class UserAudible extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the audible.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Chatroom.
|
||||
* Get the chatroom associated with the audible.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Chatroom, $this>
|
||||
* @return BelongsTo<Chatroom, $this>
|
||||
*/
|
||||
public function room(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function room(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Chatroom::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Target.
|
||||
* Get the target user associated with the audible.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function target(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function target(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Bot.
|
||||
* Get the bot associated with the audible.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Bot, $this>
|
||||
* @return BelongsTo<Bot, $this>
|
||||
*/
|
||||
public function bot(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function bot(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Bot::class);
|
||||
}
|
||||
|
||||
+13
-12
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\UserEcho.
|
||||
@@ -43,41 +44,41 @@ class UserEcho extends Model
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the echo.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Chatroom.
|
||||
* Get the chatroom associated with the echo.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Chatroom, $this>
|
||||
* @return BelongsTo<Chatroom, $this>
|
||||
*/
|
||||
public function room(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function room(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Chatroom::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Target.
|
||||
* Get the target user associated with the echo.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function target(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function target(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A Bot.
|
||||
* Get the bot that associated with the echo.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Bot, $this>
|
||||
* @return BelongsTo<Bot, $this>
|
||||
*/
|
||||
public function bot(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function bot(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Bot::class);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\UserNotification.
|
||||
@@ -61,7 +62,7 @@ class UserNotification extends Model
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates If The Model Should Be Timestamped.
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@@ -94,11 +95,11 @@ class UserNotification extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User.
|
||||
* Get the user that owns the notification settings.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
|
||||
* @return BelongsTo<User, $this>
|
||||
*/
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user