|EntryFile newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|EntryFile newQuery() * @method static \Illuminate\Database\Eloquent\Builder|EntryFile query() * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereEntryId($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereFavoriteAt($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereFavoriteServer($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereFileUuid($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereFilename($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereFilepath($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereFilesize($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereOnlinePatcher($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereSecondaryOnlinePatcher($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereState($value) * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereUpdatedAt($value) * @property-read \App\Models\PlayOnlineSetting|null $playOnlineSetting * @property int $download_count * @method static \Illuminate\Database\Eloquent\Builder|EntryFile whereDownloadCount($value) * @mixin \Eloquent */ class EntryFile extends Model { protected $fillable = [ 'entry_id', 'filename', 'filepath', 'favorite_server', 'favorite_at', 'filesize', 'state', 'file_uuid', 'online_patcher', 'secondary_online_patcher', ]; protected $casts = [ 'favorite_at' => 'timestamp' ]; public function entry(): BelongsTo { return $this->belongsTo(Entry::class); } public function playOnlineSetting(): HasOne { return $this->hasOne(PlayOnlineSetting::class,'file_id'); } public function increaseDownloadCount(): void { $this->download_count++; $this->save(); } }