| @@ 55-97 (lines=43) @@ | ||
| 52 | * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Comment whereDeleteReason($value) |
|
| 53 | * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Comment whereDeleted($value) |
|
| 54 | */ |
|
| 55 | class Comment extends Model |
|
| 56 | { |
|
| 57 | use \Venturecraft\Revisionable\RevisionableTrait; |
|
| 58 | use SoftDeletes; |
|
| 59 | ||
| 60 | public $timestamps = true; |
|
| 61 | protected $table = 'comments'; |
|
| 62 | protected $fillable = [ |
|
| 63 | 'user_id', |
|
| 64 | 'content_id', |
|
| 65 | 'content_type', |
|
| 66 | 'comment_md', |
|
| 67 | 'comment_html', |
|
| 68 | 'vote_up', |
|
| 69 | 'vote_down', |
|
| 70 | 'deleted', |
|
| 71 | 'delete_reason', |
|
| 72 | ]; |
|
| 73 | ||
| 74 | protected $dates = ['deleted_at']; |
|
| 75 | ||
| 76 | protected $guarded = []; |
|
| 77 | ||
| 78 | public function content() |
|
| 79 | { |
|
| 80 | return $this->morphTo(); |
|
| 81 | } |
|
| 82 | ||
| 83 | public function user() |
|
| 84 | { |
|
| 85 | return $this->belongsTo('App\Models\User'); |
|
| 86 | } |
|
| 87 | ||
| 88 | public function game() |
|
| 89 | { |
|
| 90 | return $this->hasOne('App\Models\Game', 'id', 'content_id')->with('user', 'maker', 'gamefiles', 'language'); |
|
| 91 | } |
|
| 92 | ||
| 93 | public function news() |
|
| 94 | { |
|
| 95 | return $this->hasOne('App\Models\News', 'id', 'content_id'); |
|
| 96 | } |
|
| 97 | } |
|
| 98 | ||
| @@ 63-104 (lines=42) @@ | ||
| 60 | * @method static \Illuminate\Database\Query\Builder|\App\Models\GamesFile withTrashed() |
|
| 61 | * @method static \Illuminate\Database\Query\Builder|\App\Models\GamesFile withoutTrashed() |
|
| 62 | */ |
|
| 63 | class GamesFile extends Model |
|
| 64 | { |
|
| 65 | use \Venturecraft\Revisionable\RevisionableTrait; |
|
| 66 | use SoftDeletes; |
|
| 67 | ||
| 68 | public $timestamps = true; |
|
| 69 | protected $table = 'games_files'; |
|
| 70 | protected $fillable = [ |
|
| 71 | 'game_id', |
|
| 72 | 'filesize', |
|
| 73 | 'extension', |
|
| 74 | 'release_type', |
|
| 75 | 'release_version', |
|
| 76 | 'release_year', |
|
| 77 | 'release_month', |
|
| 78 | 'release_day', |
|
| 79 | 'user_id', |
|
| 80 | ]; |
|
| 81 | ||
| 82 | protected $guarded = []; |
|
| 83 | protected $dates = ['deleted_at']; |
|
| 84 | ||
| 85 | public function gamefiletype() |
|
| 86 | { |
|
| 87 | return $this->hasOne('App\Models\GamesFilesType', 'id', 'release_type'); |
|
| 88 | } |
|
| 89 | ||
| 90 | public function game() |
|
| 91 | { |
|
| 92 | return $this->hasOne('App\Models\Game', 'id', 'game_id'); |
|
| 93 | } |
|
| 94 | ||
| 95 | public function playerIndex() |
|
| 96 | { |
|
| 97 | return $this->hasMany('App\Models\PlayerIndexjson', 'gamefile_id', 'id'); |
|
| 98 | } |
|
| 99 | ||
| 100 | public function user() |
|
| 101 | { |
|
| 102 | return $this->hasOne('App\Models\User', 'id', 'user_id'); |
|
| 103 | } |
|
| 104 | } |
|
| 105 | ||