mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-14 15:39:37 -06:00
40 lines
857 B
PHP
40 lines
857 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Watchlist extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* Belongs To A User.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id', 'id')->withDefault([
|
|
'username' => 'System',
|
|
'id' => '1',
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Belongs To A Uploader.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function author()
|
|
{
|
|
// Not needed yet but may use this soon.
|
|
|
|
return $this->belongsTo(User::class, 'staff_id', 'id')->withDefault([
|
|
'username' => 'System',
|
|
'id' => '1',
|
|
]);
|
|
}
|
|
}
|