You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
795 B
40 lines
795 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ParkingAccessRecord extends Model
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
protected $table = 'parking_access_record';
|
|
|
|
protected $fillable
|
|
= [
|
|
'floor_id',
|
|
'license_plate_id',
|
|
'space_id',
|
|
'status',
|
|
'enter_time',
|
|
'leave_time'
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'updated_at'
|
|
];
|
|
|
|
public function getEnterTimeAttribute($value): string
|
|
{
|
|
return get_datetime('datetime', strtotime($value));
|
|
}
|
|
|
|
public function getLeaveTimeAttribute($value): string
|
|
{
|
|
return $value ? get_datetime('datetime', strtotime($value)) : '';
|
|
}
|
|
|
|
}
|
|
|