You've already forked Atomcms-edit
Initial commit
This commit is contained in:
Executable
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\BelongsToUser;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class RadioContestEntry extends Model
|
||||
{
|
||||
use BelongsToUser;
|
||||
|
||||
#[\Override]
|
||||
protected $table = 'radio_contest_entries';
|
||||
|
||||
#[\Override]
|
||||
protected $guarded = ['id', 'created_at', 'updated_at', 'user_id', 'contest_id'];
|
||||
|
||||
/** @var array<string, string> */
|
||||
#[\Override]
|
||||
protected $casts = [
|
||||
'submitted_at' => 'datetime',
|
||||
'is_winner' => 'boolean',
|
||||
];
|
||||
|
||||
public function contest(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(RadioContest::class);
|
||||
}
|
||||
|
||||
public function markAsWinner(): void
|
||||
{
|
||||
$this->update(['is_winner' => true]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user