Refactor code for improved readability and consistency

- Removed unnecessary blank lines in various files to enhance code clarity.
- Updated comments for consistency and clarity across multiple classes and methods.
- Adjusted spacing in test files for better formatting and readability.
This commit is contained in:
Mekan1206
2026-02-08 02:24:43 +05:00
parent 2dfa3747b5
commit c46eccb24f
38 changed files with 257 additions and 257 deletions

View File

@@ -23,7 +23,7 @@ trait HasPropertiesJson
foreach ($this->properties as $property) {
$attributeSlug = $property->attribute->slug;
if (! isset($propertiesJson[$attributeSlug])) {
$propertiesJson[$attributeSlug] = [];
}
@@ -34,12 +34,12 @@ trait HasPropertiesJson
if ($value->value) {
$propertiesJson[$attributeSlug][] = $value->value->key;
}
if ($value->product_custom_value) {
$propertiesJson[$attributeSlug][] = $value->product_custom_value;
}
}
// Unique values just in case
$propertiesJson[$attributeSlug] = array_values(array_unique($propertiesJson[$attributeSlug]));
}

View File

@@ -27,16 +27,16 @@ class Product extends Model implements HasMedia, Viewable
*/
use HasFactory;
/**
* Has Schemaless Attributes (spatie/laravel-schemaless-attributes)
*/
use HasSchemalessAttributes;
/**
* Has Properties Json
*/
use HasPropertiesJson;
/**
* Has Schemaless Attributes (spatie/laravel-schemaless-attributes)
*/
use HasSchemalessAttributes;
/**
* Has Slug (spatie/laravel-sluggable)
*/

View File

@@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\Model;
* @property int $id
* @property string $version
* @property string $os
* @property bool $important
* @property bool $important
* @property string $notes
* @property \Carbon\Carbon|null $created_at
* @property \Carbon\Carbon|null $updated_at