停车场管理系统
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.
 
 

45 lines
908 B

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ParkingSpaceAttributes extends Model
{
use HasFactory;
protected $table = 'parking_space_attributes';
protected $fillable = [
'attributes',
'import_diagram'
];
protected $hidden
= [
'created_at',
'updated_at',
'deleted_at'
];
/**
* @return array
*/
public static function getList(): array
{
return self::query()->get()->select(
['id', 'attributes']
)->toArray();
}
public static function getAttr($id)
{
return self::query()->where('id', $id)->value('attributes') ?? '';
}
public static function getData(): array
{
return self::query()->select(['id', 'attributes'])->get()->toArray();
}
}