wip
This commit is contained in:
1 parent
75d7914a59
commit
dc76eb35ae
21 files changed
+177
-178
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user