Lstm_prediction/lstm_prediction/app/Models/SensorData.php

20 lines
428 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class SensorData extends Model
{
use HasFactory;
// Kolom yang bisa diisi (fillable)
protected $fillable = ['temperature', 'humidity', 'created_at'];
// Format `created_at` saat dikembalikan dalam JSON
protected $casts = [
'created_at' => 'datetime:Y-m-d H:i:s',
];
}