20 lines
470 B
PHP
20 lines
470 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Prediction extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
// Kolom yang bisa diisi (fillable)
|
|
protected $fillable = ['predicted_suhu', 'predicted_kelembaban', 'prediction_datetime'];
|
|
|
|
// Format `prediction_datetime` saat dikembalikan dalam JSON
|
|
protected $casts = [
|
|
'prediction_datetime' => 'datetime:Y-m-d H:i:s',
|
|
];
|
|
}
|