A lot of things
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user