wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class SofaScoreTask extends Model
|
||||
{
|
||||
protected $appends = ['duration'];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'mode',
|
||||
'sport_id',
|
||||
'day_from',
|
||||
'day_to',
|
||||
'is_active',
|
||||
'compleated',
|
||||
'last_start',
|
||||
'last_end',
|
||||
];
|
||||
|
||||
public function getDurationAttribute(): string
|
||||
{
|
||||
return Carbon::parse($this->last_start)->diff(Carbon::parse($this->last_end));
|
||||
}
|
||||
|
||||
public function sport()
|
||||
{
|
||||
return $this->belongsTo(Sport::class);
|
||||
}
|
||||
|
||||
public function sofa_score_task_tournaments()
|
||||
{
|
||||
return $this->hasMany(SofaScoreTaskTournament::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user