Преглед на файлове

criada a exibicao de icones das estatisticas da landingpage de forma dinamica conforme o cadastro nas configs da empresa no sistema web serprati_digital

Gustavo Zanatta преди 1 ден
родител
ревизия
c11fa6e547

+ 3 - 0
app/Http/Requests/CompanySettingRequest.php

@@ -13,10 +13,13 @@ class CompanySettingRequest extends FormRequest
             'hero_subtitle'     => 'sometimes|nullable|string|max:1000',
             'stat1_value'       => 'sometimes|nullable|string|max:50',
             'stat1_label'       => 'sometimes|nullable|string|max:100',
+            'stat1_icon'        => 'sometimes|nullable|string|max:100',
             'stat2_value'       => 'sometimes|nullable|string|max:50',
             'stat2_label'       => 'sometimes|nullable|string|max:100',
+            'stat2_icon'        => 'sometimes|nullable|string|max:100',
             'stat3_value'       => 'sometimes|nullable|string|max:50',
             'stat3_label'       => 'sometimes|nullable|string|max:100',
+            'stat3_icon'        => 'sometimes|nullable|string|max:100',
             'about_vision'      => 'sometimes|nullable|string|max:2000',
             'about_mission'     => 'sometimes|nullable|string|max:2000',
             'about_values'      => 'sometimes|nullable|string|max:2000',

+ 3 - 0
app/Http/Resources/CompanySettingResource.php

@@ -21,10 +21,13 @@ class CompanySettingResource extends JsonResource
             'hero_subtitle'          => $this->hero_subtitle,
             'stat1_value'            => $this->stat1_value,
             'stat1_label'            => $this->stat1_label,
+            'stat1_icon'             => $this->stat1_icon,
             'stat2_value'            => $this->stat2_value,
             'stat2_label'            => $this->stat2_label,
+            'stat2_icon'             => $this->stat2_icon,
             'stat3_value'            => $this->stat3_value,
             'stat3_label'            => $this->stat3_label,
+            'stat3_icon'             => $this->stat3_icon,
             'about_vision'           => $this->about_vision,
             'about_mission'          => $this->about_mission,
             'about_values'           => $this->about_values,

+ 35 - 0
database/migrations/2026_08_13_000001_add_stat_icons_to_company_settings_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    public function up(): void
+    {
+        Schema::table('company_settings', function (Blueprint $table) {
+            $table->string('stat1_icon')->nullable();
+            $table->string('stat2_icon')->nullable();
+            $table->string('stat3_icon')->nullable();
+        });
+
+        DB::table('company_settings')->update([
+            'stat1_icon' => 'mdi-account-group',
+            'stat2_icon' => 'mdi-handshake',
+            'stat3_icon' => 'mdi-heart-outline',
+        ]);
+    }
+
+    public function down(): void
+    {
+        Schema::table('company_settings', function (Blueprint $table) {
+            $table->dropColumn([
+                'stat1_icon',
+                'stat2_icon',
+                'stat3_icon',
+            ]);
+        });
+    }
+};