44 lines
895 B
PHP
44 lines
895 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
use App\Models\User;
|
||
|
|
use DateTimeInterface;
|
||
|
|
|
||
|
|
|
||
|
|
class UserOverView extends Model {
|
||
|
|
|
||
|
|
use HasFactory;
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected function serializeDate(DateTimeInterface $date) {
|
||
|
|
return $date->format('d-m-Y H:i:s');
|
||
|
|
}
|
||
|
|
|
||
|
|
protected $dates = ['deleted_at'];
|
||
|
|
protected $table = 'user_over_views';
|
||
|
|
protected $fillable = [
|
||
|
|
'user_id',
|
||
|
|
'muscle_rate',
|
||
|
|
'body_fat',
|
||
|
|
'skeletal_muscle',
|
||
|
|
'protein',
|
||
|
|
'bmr',
|
||
|
|
'water',
|
||
|
|
'age'
|
||
|
|
];
|
||
|
|
|
||
|
|
public function user() {
|
||
|
|
return $this->belongsTo(User::class, 'id', 'user_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function userData()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|