diff --git a/app/Models/ParkingSpaceAttributes.php b/app/Models/ParkingSpaceAttributes.php index a77cb59..22bca01 100644 --- a/app/Models/ParkingSpaceAttributes.php +++ b/app/Models/ParkingSpaceAttributes.php @@ -34,9 +34,13 @@ class ParkingSpaceAttributes extends Model )->toArray(); } - public static function getTypeList(): array + public static function getTypeList($is_default = 1): array { - $data = self::query()->where('is_default', 0)->get()->select( + $model = self::query(); + if ($is_default == 1) { + $model->where('is_default', 0); + } + $data = $model->get()->select( ['id', 'attributes'] )->toArray(); foreach ($data as $key => $item) {