diff --git a/app/Enums/AksesPasar/TingkatKepercayaanPembeli.php b/app/Enums/AksesPasar/TingkatKepercayaanPembeli.php new file mode 100644 index 0000000..a373672 --- /dev/null +++ b/app/Enums/AksesPasar/TingkatKepercayaanPembeli.php @@ -0,0 +1,26 @@ + self::SANGAT_PERCAYA->value, 'label' => 'Sangat percaya, berani langsung coba'], + ['value' => self::CUKUP_PERCAYA->value, 'label' => 'Cukup percaya, tapi hati hati'], + ['value' => self::RAGU_RAGU->value, 'label' => 'Ragu ragu'], + ['value' => self::TIDAK_PERCAYA->value, 'label' => 'Tidak percaya, enggan mencoba'], + ]; + } + + public static function values(): array + { + return array_column(self::cases(), 'value'); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Web/Produktivitas/AksesPasarController.php b/app/Http/Controllers/Web/Produktivitas/AksesPasarController.php index 6c14be4..1005c90 100644 --- a/app/Http/Controllers/Web/Produktivitas/AksesPasarController.php +++ b/app/Http/Controllers/Web/Produktivitas/AksesPasarController.php @@ -16,6 +16,7 @@ use App\Enums\AksesPasar\SkorPengalaman; use App\Enums\AksesPasar\SaluranTerdahulu; use App\Enums\AksesPasar\PraktikFermentasi; use App\Enums\AksesPasar\SkorKesadaranPremium; +use App\Enums\AksesPasar\TingkatKepercayaanPembeli; class AksesPasarController extends Controller { @@ -113,6 +114,7 @@ class AksesPasarController extends Controller 'praktikFermentasiOptions' => PraktikFermentasi::options(), 'praktikBelumPernahValue' => PraktikFermentasi::BELUM_PERNAH->value, 'skorKesadaranPremiumOptions' => SkorKesadaranPremium::options(), + 'tingkatKepercayaanOptions' => TingkatKepercayaanPembeli::options(), 'skorPengalamanBerhentiValues' => [ SkorPengalaman::PERNAH_BERHENTI_TIDAK_ADA_AKSES->value, SkorPengalaman::PERNAH_BERHENTI_MUNGKIN_KEMBALI->value @@ -154,6 +156,9 @@ class AksesPasarController extends Controller 'skor_kesadaran_premium' => ['nullable', 'integer', Rule::in(SkorKesadaranPremium::values())], 'sumber_info_premium' => ['nullable', 'string', 'max:255'], + + 'tingkat_kepercayaan_pembeli_baru' => ['nullable', 'integer', Rule::in(TingkatKepercayaanPembeli::values())], + 'alasan_kepercayaan_pembeli_baru' => ['nullable', 'string'], 'harga_jual' => ['nullable', 'array'], 'harga_jual.*.bentuk_produk' => ['nullable', 'string'], diff --git a/database/migrations/2026_07_30_100935_add_kepercayaan_to_akses_pasar_table.php b/database/migrations/2026_07_30_100935_add_kepercayaan_to_akses_pasar_table.php new file mode 100644 index 0000000..9fbae01 --- /dev/null +++ b/database/migrations/2026_07_30_100935_add_kepercayaan_to_akses_pasar_table.php @@ -0,0 +1,26 @@ +tinyInteger('tingkat_kepercayaan_pembeli_baru')->nullable()->after('sumber_info_premium'); + $table->text('alasan_kepercayaan_pembeli_baru')->nullable()->after('tingkat_kepercayaan_pembeli_baru'); + }); +} + + public function down(): void +{ + Schema::table('akses_pasar', function (Blueprint $table) { + $table->dropColumn(['tingkat_kepercayaan_pembeli_baru', 'alasan_kepercayaan_pembeli_baru']); + }); +} +}; diff --git a/resources/views/produktivitas/petani/akses-pasar/index.blade.php b/resources/views/produktivitas/petani/akses-pasar/index.blade.php index 9894264..9ecac65 100644 --- a/resources/views/produktivitas/petani/akses-pasar/index.blade.php +++ b/resources/views/produktivitas/petani/akses-pasar/index.blade.php @@ -207,6 +207,37 @@ +