A lot of things

This commit is contained in:
2026-06-16 16:21:43 +02:00
parent 4f9f6c63b3
commit 7e1e26f20b
126 changed files with 7917 additions and 204 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* @property int $id
@@ -36,6 +37,9 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
* @method static \Illuminate\Database\Eloquent\Builder<static>|EntryFile whereSecondaryOnlinePatcher($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|EntryFile whereState($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|EntryFile whereUpdatedAt($value)
* @property-read \App\Models\PlayOnlineSetting|null $playOnlineSetting
* @property int $download_count
* @method static \Illuminate\Database\Eloquent\Builder<static>|EntryFile whereDownloadCount($value)
* @mixin \Eloquent
*/
class EntryFile extends Model
@@ -53,4 +57,15 @@ class EntryFile extends Model
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();
}
}