36 lines
949 B
PHP
36 lines
949 B
PHP
<?php
|
|
|
|
namespace App\Modules\Machines\Infrastructure\Persistence\Eloquent;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\Table;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* Persistence model, used only inside the Machines Infrastructure layer.
|
|
*
|
|
* @property int $id
|
|
* @property int $machine_counter_id
|
|
* @property int $reading_milli
|
|
* @property int $user_id
|
|
* @property Carbon $read_at
|
|
*/
|
|
#[Table('machine_counter_readings')]
|
|
#[Fillable(['machine_counter_id', 'reading_milli', 'user_id', 'read_at'])]
|
|
class MachineCounterReadingModel extends Model
|
|
{
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'machine_counter_id' => 'integer',
|
|
'reading_milli' => 'integer',
|
|
'user_id' => 'integer',
|
|
'read_at' => 'immutable_datetime',
|
|
];
|
|
}
|
|
}
|