This commit is contained in:
salam committed 2026-07-03 10:55:55 +02:00
1 parent 75d7914a59
commit dc76eb35ae
21 files changed
+177 -178

No files matched your search

+8
View File
@@ -3,9 +3,12 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;
class SofaScoreTask extends Model
{
protected $appends = ['duration'];
protected $fillable = [
'name',
'mode',
@@ -20,6 +23,11 @@ class SofaScoreTask extends Model
'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);