Menyelesaikan fitur Basic Data KJPP untuk menambahkan lebih dari satu email kantor, pic reviewer, pic admin, pic marketing
This commit is contained in:
@@ -5,8 +5,6 @@ namespace Modules\Lpj\Http\Controllers;
|
||||
use Throwable;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Lpj\Models\KJPP;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Lpj\Models\Branch;
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Lpj\Models\IjinUsaha;
|
||||
use Modules\Lpj\Exports\KJPPExport;
|
||||
@@ -57,9 +55,80 @@ class KJPPController extends Controller
|
||||
{
|
||||
$validated = $request->validated();
|
||||
|
||||
dd($validated);
|
||||
|
||||
if ($validated) {
|
||||
$detailEmailKantor = [];
|
||||
$detailNamaPicReviewer = [];
|
||||
$detailNomorHpPicReviewer = [];
|
||||
$detailNamaPicAdmin = [];
|
||||
$detailNomorHpPicAdmin = [];
|
||||
$detailNamaPicMarketing = [];
|
||||
$detailNomorHpPicMarketing = [];
|
||||
|
||||
$emailKantor = $request->input('detail_email_kantor.email_kantor', []);
|
||||
$namaPicReviewer = $request->input('detail_nama_pic_reviewer.nama_pic_reviewer', []);
|
||||
$nomorHpPicReviewer = $request->input('detail_nomor_hp_pic_reviewer.nomor_hp_pic_reviewer', []);
|
||||
$namaPicAdmin = $request->input('detail_nama_pic_admin.nama_pic_admin', []);
|
||||
$nomorHpPicAdmin = $request->input('detail_nomor_hp_pic_admin.nomor_hp_pic_admin', []);
|
||||
$namaPicMarketing = $request->input('detail_nama_pic_marketing.nama_pic_marketing', []);
|
||||
$nomorHpPicMarketing = $request->input('detail_nomor_hp_pic_marketing.nomor_hp_pic_marketing', []);
|
||||
|
||||
foreach ($emailKantor as $value) {
|
||||
$detailEmailKantor[] = [
|
||||
'email_kantor' => $value
|
||||
];
|
||||
}
|
||||
// Encode to JSON and store
|
||||
$detailEmailKantorJson = json_encode($detailEmailKantor);
|
||||
|
||||
// Process detail_nama_pic_reviewer
|
||||
foreach ($namaPicReviewer as $value) {
|
||||
$detailNamaPicReviewer[] = [
|
||||
'nama_pic_reviewer' => $value
|
||||
];
|
||||
}
|
||||
$detailNamaPicReviewerJson = json_encode($detailNamaPicReviewer);
|
||||
|
||||
// Process detail_nomor_hp_pic_reviewer
|
||||
foreach ($nomorHpPicReviewer as $value) {
|
||||
$detailNomorHpPicReviewer[] = [
|
||||
'nomor_hp_pic_reviewer' => $value
|
||||
];
|
||||
}
|
||||
$detailNomorHpPicReviewerJson = json_encode($detailNomorHpPicReviewer);
|
||||
|
||||
// Process detail_nama_pic_admin
|
||||
foreach ($namaPicAdmin as $value) {
|
||||
$detailNamaPicAdmin[] = [
|
||||
'nama_pic_admin' => $value
|
||||
];
|
||||
}
|
||||
$detailNamaPicAdminJson = json_encode($detailNamaPicAdmin);
|
||||
|
||||
// Process detail_nomor_hp_pic_admin
|
||||
foreach ($nomorHpPicAdmin as $value) {
|
||||
$detailNomorHpPicAdmin[] = [
|
||||
'nomor_hp_pic_admin' => $value
|
||||
];
|
||||
}
|
||||
$detailNomorHpPicAdminJson = json_encode($detailNomorHpPicAdmin);
|
||||
|
||||
// Process detail_nama_pic_marketing
|
||||
foreach ($namaPicMarketing as $value) {
|
||||
$detailNamaPicMarketing[] = [
|
||||
'nama_pic_marketing' => $value
|
||||
];
|
||||
}
|
||||
$detailNamaPicMarketingJson = json_encode($detailNamaPicMarketing);
|
||||
|
||||
// Process detail_nomor_hp_pic_marketing
|
||||
foreach ($nomorHpPicMarketing as $value) {
|
||||
$detailNomorHpPicMarketing[] = [
|
||||
'nomor_hp_pic_marketing' => $value
|
||||
];
|
||||
}
|
||||
$detailNomorHpPicMarketingJson = json_encode($detailNomorHpPicMarketing);
|
||||
|
||||
|
||||
$file = $request->file('attachment');
|
||||
$filename = $file ? time() . '.' . $file->getClientOriginalExtension() : 'default.pdf';
|
||||
|
||||
@@ -71,9 +140,20 @@ class KJPPController extends Controller
|
||||
Storage::copy('public/test/default.pdf', 'public/uploads_pdf/' . $filename);
|
||||
}
|
||||
|
||||
$validated['detail_email_kantor'] = $detailEmailKantorJson;
|
||||
$validated['detail_nama_pic_reviewer'] = $detailNamaPicReviewerJson;
|
||||
$validated['detail_nomor_hp_pic_reviewer'] = $detailNomorHpPicReviewerJson;
|
||||
$validated['detail_nama_pic_admin'] = $detailNamaPicAdminJson;
|
||||
$validated['detail_nomor_hp_pic_admin'] = $detailNomorHpPicAdminJson;
|
||||
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
||||
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
||||
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||
// Tambahkan nama file ke data yang divalidasi
|
||||
$validated['attachment'] = $filename;
|
||||
|
||||
// dd($validated);
|
||||
|
||||
// Simpan data ke database
|
||||
KJPP::create($validated);
|
||||
|
||||
@@ -100,8 +180,36 @@ class KJPPController extends Controller
|
||||
$cities = City::where('code', $kjpp->city_code)->get();
|
||||
$districts = District::where('code', $kjpp->district_code)->get();
|
||||
$villages = Village::where('code', $kjpp->village_code)->get();
|
||||
// dd($branches);
|
||||
return view('lpj::kjpp.show', compact('jenis_jaminan', 'ijin_usahas', 'ijin_usaha', 'kjpp', 'provinces', 'cities', 'districts', 'villages'));
|
||||
$detailEmailKantor = json_decode($kjpp->detail_email_kantor);
|
||||
$detailNamaPicReviewer = json_decode($kjpp->detail_nama_pic_reviewer);
|
||||
$detailNomorHpPicReviewer = json_decode($kjpp->detail_nomor_hp_pic_reviewer);
|
||||
$detailNamaPicAdmin = json_decode($kjpp->detail_nama_pic_admin);
|
||||
$detailNomorHpPicAdmin = json_decode($kjpp->detail_nomor_hp_pic_admin);
|
||||
$detailNamaPicMarketing = json_decode($kjpp->detail_nama_pic_marketing);
|
||||
$detailNomorHpPicMarketing = json_decode($kjpp->detail_nomor_hp_pic_marketing);
|
||||
|
||||
$detailJoinPicReviewer = json_encode(array_map(function ($nama, $nomor) {
|
||||
return [
|
||||
'nama_pic_reviewer' => $nama->nama_pic_reviewer,
|
||||
'nomor_hp_pic_reviewer' => $nomor->nomor_hp_pic_reviewer
|
||||
];
|
||||
}, $detailNamaPicReviewer, $detailNomorHpPicReviewer));
|
||||
|
||||
$detailJoinPicAdmin = json_encode(array_map(function ($nama, $nomor) {
|
||||
return [
|
||||
'nama_pic_admin' => $nama->nama_pic_admin,
|
||||
'nomor_hp_pic_admin' => $nomor->nomor_hp_pic_admin
|
||||
];
|
||||
}, $detailNamaPicAdmin, $detailNomorHpPicAdmin));
|
||||
|
||||
$detailJoinPicMarketing = json_encode(array_map(function ($nama, $nomor) {
|
||||
return [
|
||||
'nama_pic_marketing' => $nama->nama_pic_marketing,
|
||||
'nomor_hp_pic_marketing' => $nomor->nomor_hp_pic_marketing
|
||||
];
|
||||
}, $detailNamaPicMarketing, $detailNomorHpPicMarketing));
|
||||
|
||||
return view('lpj::kjpp.show', compact('jenis_jaminan', 'ijin_usahas', 'ijin_usaha', 'kjpp', 'provinces', 'cities', 'districts', 'villages', 'detailEmailKantor', 'detailJoinPicReviewer', 'detailJoinPicAdmin', 'detailJoinPicMarketing'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,8 +224,36 @@ class KJPPController extends Controller
|
||||
$cities = City::where('province_code', $kjpp->province_code)->get();
|
||||
$districts = District::where('city_code', $kjpp->city_code)->get();
|
||||
$villages = Village::where('district_code', $kjpp->district_code)->get();
|
||||
$detailEmailKantor = json_decode($kjpp->detail_email_kantor);
|
||||
$detailNamaPicReviewer = json_decode($kjpp->detail_nama_pic_reviewer);
|
||||
$detailNomorHpPicReviewer = json_decode($kjpp->detail_nomor_hp_pic_reviewer);
|
||||
$detailNamaPicAdmin = json_decode($kjpp->detail_nama_pic_admin);
|
||||
$detailNomorHpPicAdmin = json_decode($kjpp->detail_nomor_hp_pic_admin);
|
||||
$detailNamaPicMarketing = json_decode($kjpp->detail_nama_pic_marketing);
|
||||
$detailNomorHpPicMarketing = json_decode($kjpp->detail_nomor_hp_pic_marketing);
|
||||
|
||||
return view('lpj::kjpp.create', compact('kjpp', 'ijin_usaha', 'jenis_aset', 'provinces', 'cities', 'districts', 'villages'));
|
||||
$detailJoinPicReviewer = json_encode(array_map(function ($nama, $nomor) {
|
||||
return [
|
||||
'nama_pic_reviewer' => $nama->nama_pic_reviewer,
|
||||
'nomor_hp_pic_reviewer' => $nomor->nomor_hp_pic_reviewer
|
||||
];
|
||||
}, $detailNamaPicReviewer, $detailNomorHpPicReviewer));
|
||||
|
||||
$detailJoinPicAdmin = json_encode(array_map(function ($nama, $nomor) {
|
||||
return [
|
||||
'nama_pic_admin' => $nama->nama_pic_admin,
|
||||
'nomor_hp_pic_admin' => $nomor->nomor_hp_pic_admin
|
||||
];
|
||||
}, $detailNamaPicAdmin, $detailNomorHpPicAdmin));
|
||||
|
||||
$detailJoinPicMarketing = json_encode(array_map(function ($nama, $nomor) {
|
||||
return [
|
||||
'nama_pic_marketing' => $nama->nama_pic_marketing,
|
||||
'nomor_hp_pic_marketing' => $nomor->nomor_hp_pic_marketing
|
||||
];
|
||||
}, $detailNamaPicMarketing, $detailNomorHpPicMarketing));
|
||||
|
||||
return view('lpj::kjpp.create', compact('kjpp', 'ijin_usaha', 'jenis_aset', 'provinces', 'cities', 'districts', 'villages', 'detailJoinPicReviewer', 'detailJoinPicAdmin', 'detailJoinPicMarketing', 'detailEmailKantor'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,7 +263,82 @@ class KJPPController extends Controller
|
||||
{
|
||||
$validated = $request->validated();
|
||||
|
||||
// dd($validated);
|
||||
|
||||
if ($validated) {
|
||||
$detailEmailKantor = [];
|
||||
$detailNamaPicReviewer = [];
|
||||
$detailNomorHpPicReviewer = [];
|
||||
$detailNamaPicAdmin = [];
|
||||
$detailNomorHpPicAdmin = [];
|
||||
$detailNamaPicMarketing = [];
|
||||
$detailNomorHpPicMarketing = [];
|
||||
|
||||
$emailKantor = $request->input('detail_email_kantor.email_kantor', []);
|
||||
$namaPicReviewer = $request->input('detail_nama_pic_reviewer.nama_pic_reviewer', []);
|
||||
$nomorHpPicReviewer = $request->input('detail_nomor_hp_pic_reviewer.nomor_hp_pic_reviewer', []);
|
||||
$namaPicAdmin = $request->input('detail_nama_pic_admin.nama_pic_admin', []);
|
||||
$nomorHpPicAdmin = $request->input('detail_nomor_hp_pic_admin.nomor_hp_pic_admin', []);
|
||||
$namaPicMarketing = $request->input('detail_nama_pic_marketing.nama_pic_marketing', []);
|
||||
$nomorHpPicMarketing = $request->input('detail_nomor_hp_pic_marketing.nomor_hp_pic_marketing', []);
|
||||
|
||||
foreach ($emailKantor as $value) {
|
||||
$detailEmailKantor[] = [
|
||||
'email_kantor' => $value
|
||||
];
|
||||
}
|
||||
// Encode to JSON and store
|
||||
$detailEmailKantorJson = json_encode($detailEmailKantor);
|
||||
|
||||
// Process detail_nama_pic_reviewer
|
||||
foreach ($namaPicReviewer as $value) {
|
||||
$detailNamaPicReviewer[] = [
|
||||
'nama_pic_reviewer' => $value
|
||||
];
|
||||
}
|
||||
$detailNamaPicReviewerJson = json_encode($detailNamaPicReviewer);
|
||||
|
||||
// Process detail_nomor_hp_pic_reviewer
|
||||
foreach ($nomorHpPicReviewer as $value) {
|
||||
$detailNomorHpPicReviewer[] = [
|
||||
'nomor_hp_pic_reviewer' => $value
|
||||
];
|
||||
}
|
||||
$detailNomorHpPicReviewerJson = json_encode($detailNomorHpPicReviewer);
|
||||
|
||||
// Process detail_nama_pic_admin
|
||||
foreach ($namaPicAdmin as $value) {
|
||||
$detailNamaPicAdmin[] = [
|
||||
'nama_pic_admin' => $value
|
||||
];
|
||||
}
|
||||
$detailNamaPicAdminJson = json_encode($detailNamaPicAdmin);
|
||||
|
||||
// Process detail_nomor_hp_pic_admin
|
||||
foreach ($nomorHpPicAdmin as $value) {
|
||||
$detailNomorHpPicAdmin[] = [
|
||||
'nomor_hp_pic_admin' => $value
|
||||
];
|
||||
}
|
||||
$detailNomorHpPicAdminJson = json_encode($detailNomorHpPicAdmin);
|
||||
|
||||
// Process detail_nama_pic_marketing
|
||||
foreach ($namaPicMarketing as $value) {
|
||||
$detailNamaPicMarketing[] = [
|
||||
'nama_pic_marketing' => $value
|
||||
];
|
||||
}
|
||||
$detailNamaPicMarketingJson = json_encode($detailNamaPicMarketing);
|
||||
|
||||
// Process detail_nomor_hp_pic_marketing
|
||||
foreach ($nomorHpPicMarketing as $value) {
|
||||
$detailNomorHpPicMarketing[] = [
|
||||
'nomor_hp_pic_marketing' => $value
|
||||
];
|
||||
}
|
||||
$detailNomorHpPicMarketingJson = json_encode($detailNomorHpPicMarketing);
|
||||
|
||||
|
||||
$file = $request->file('attachment');
|
||||
$filename = $file ? time() . '.' . $file->getClientOriginalExtension() : null;
|
||||
|
||||
@@ -147,6 +358,16 @@ class KJPPController extends Controller
|
||||
$validated['attachment'] = $kjpp->attachment ?? 'default.pdf';
|
||||
}
|
||||
|
||||
$validated['detail_email_kantor'] = $detailEmailKantorJson;
|
||||
$validated['detail_nama_pic_reviewer'] = $detailNamaPicReviewerJson;
|
||||
$validated['detail_nomor_hp_pic_reviewer'] = $detailNomorHpPicReviewerJson;
|
||||
$validated['detail_nama_pic_admin'] = $detailNamaPicAdminJson;
|
||||
$validated['detail_nomor_hp_pic_admin'] = $detailNomorHpPicAdminJson;
|
||||
$validated['detail_nama_pic_marketing'] = $detailNamaPicMarketingJson;
|
||||
$validated['detail_nomor_hp_pic_marketing'] = $detailNomorHpPicMarketingJson;
|
||||
$validated['ijin_usaha_id'] = json_encode($validated['ijin_usaha_id']);
|
||||
$validated['jenis_aset_id'] = json_encode($validated['jenis_aset_id']);
|
||||
|
||||
// Perbarui data di database
|
||||
KJPP::where('id', $id)->update($validated);
|
||||
|
||||
|
||||
@@ -23,24 +23,24 @@ class KJPPRequest extends FormRequest
|
||||
'postal_code' => 'nullable|numeric',
|
||||
'nomor_telepon_kantor' => 'nullable|numeric|digits_between:8,15',
|
||||
'email_kantor' => 'required|email',
|
||||
'detail_email_kantor' => 'nullable|email',
|
||||
'detail_email_kantor' => 'nullable',
|
||||
'nama_pimpinan' => 'required|string|not_regex:/^\d+$/|max:255',
|
||||
'nomor_hp_pimpinan' => 'required|numeric|digits_between:10,15',
|
||||
'nama_pic_reviewer' => 'nullable|string|not_regex:/^\d+$/|max:255',
|
||||
// 'detail_nama_pic_reviewer' => 'nullable|string|not_regex:/^\d+$/|max:255',
|
||||
'detail_nama_pic_reviewer' => 'nullable',
|
||||
'nomor_hp_pic_reviewer' => 'nullable|numeric|digits_between:10,15',
|
||||
// 'detail_nomor_hp_pic_reviewer' => 'nullable|numeric|digits_between:10,15',
|
||||
'detail_nomor_hp_pic_reviewer' => 'nullable',
|
||||
'nama_pic_admin' => 'nullable|string|not_regex:/^\d+$/|max:255',
|
||||
// 'detail_nama_pic_admin' => 'nullable|string|not_regex:/^\d+$/|max:255',
|
||||
'detail_nama_pic_admin' => 'nullable',
|
||||
'nomor_hp_pic_admin' => 'nullable|numeric|digits_between:10,15',
|
||||
// 'detail_nomor_hp_pic_admin' => 'nullable|numeric|digits_between:10,15',
|
||||
'detail_nomor_hp_pic_admin' => 'nullable',
|
||||
'nama_pic_marketing' => 'nullable|string|not_regex:/^\d+$/|max:255',
|
||||
// 'detail_nama_pic_marketing' => 'nullable|string|not_regex:/^\d+$/|max:255',
|
||||
'detail_nama_pic_marketing' => 'nullable',
|
||||
'nomor_hp_pic_marketing' => 'nullable|numeric|digits_between:10,15',
|
||||
// 'detail_nomor_hp_pic_marketing' => 'nullable|numeric|digits_between:10,15',
|
||||
'ijin_usaha_id' => 'nullable|array',
|
||||
'detail_nomor_hp_pic_marketing' => 'nullable',
|
||||
'ijin_usaha_id' => 'required|array',
|
||||
'ijin_usaha_id.*' => 'exists:ijin_usaha,code',
|
||||
'jenis_aset_id' => 'nullable|array',
|
||||
'jenis_aset_id' => 'required|array',
|
||||
'jenis_aset_id.*' => 'exists:jenis_jaminan,code',
|
||||
'attachment' => 'nullable|mimes:pdf|max:1024'
|
||||
];
|
||||
@@ -81,126 +81,24 @@ class KJPPRequest extends FormRequest
|
||||
'nomor_telepon_kantor.digits_between' => 'Nomor Telepon Kantor minimum 8 digit dan maksimum 15 digit!',
|
||||
'email_kantor.required' => 'Email Kantor Wajib diisi!',
|
||||
'email_kantor.email' => 'Email Kantor tidak valid!',
|
||||
// 'detail_email_kantor.email' => 'Email Kantor tidak valid!',
|
||||
'nama_pimpinan.required' => 'Nama Pimpinan Wajib diisi!',
|
||||
'nama_pimpinan.not_regex' => 'Nama Pimpinan harus berupa huruf!',
|
||||
'nomor_hp_pimpinan.required' => 'Nomor HP Pimpinan Wajib diisi!',
|
||||
'nomor_hp_pimpinan.numeric' => 'Nomor HP Pimpinan harus berupa angka!',
|
||||
'nomor_hp_pimpinan.digits_between' => 'Nomor HP Pimpinan minimum 10 digit dan maksimum 15 digit!',
|
||||
'nama_pic_reviewer.not_regex' => 'Nama PIC Reviewer harus berupa huruf!',
|
||||
// 'detail_nama_pic_reviewer.not_regex' => 'Nama PIC Reviewer harus berupa huruf!',
|
||||
'nomor_hp_pic_reviewer.numeric' => 'Nomor HP PIC Reviewer harus berupa angka!',
|
||||
// 'detail_nomor_hp_pic_reviewer.numeric' => 'Nomor HP PIC Reviewer harus berupa angka!',
|
||||
'nomor_hp_pic_reviewer.digits_between' => 'Nomor HP PIC Reviewer minimum 10 digit dan maksimum 15 digit!',
|
||||
// 'detail_nomor_hp_pic_reviewer.digits_between' => 'Nomor HP PIC Reviewer minimum 10 digit dan maksimum 15 digit!',
|
||||
'nama_pic_admin.not_regex' => 'Nama PIC Admin harus berupa huruf!',
|
||||
// 'detail_nama_pic_admin.not_regex' => 'Nama PIC Admin harus berupa huruf!',
|
||||
'nomor_hp_pic_admin.numeric' => 'Nomor HP PIC Admin harus berupa angka!',
|
||||
// 'detail_nomor_hp_pic_admin.numeric' => 'Nomor HP PIC Admin harus berupa angka!',
|
||||
'nomor_hp_pic_admin.digits_between' => 'Nomor HP PIC Admin minimum 10 digit dan maksimum 15 digit!',
|
||||
// 'detail_nomor_hp_pic_admin.digits_between' => 'Nomor HP PIC Admin minimum 10 digit dan maksimum 15 digit!',
|
||||
'nama_pic_marketing.not_regex' => 'Nama PIC Marketing harus berupa huruf!',
|
||||
// 'detail_nama_pic_marketing.not_regex' => 'Nama PIC Marketing harus berupa huruf!',
|
||||
'nomor_hp_pic_marketing.numeric' => 'Nomor HP PIC Marketing harus berupa angka!',
|
||||
// 'detail_nomor_hp_pic_marketing.numeric' => 'Nomor HP PIC Marketing harus berupa angka!',
|
||||
'nomor_hp_pic_marketing.digits_between' => 'Nomor HP PIC Marketing minimum 10 digit dan maksimum 15 digit!',
|
||||
// 'detail_nomor_hp_pic_marketing.digits_between' => 'Nomor HP PIC Marketing minimum 10 digit dan maksimum 15 digit!',
|
||||
'ijin_usaha_id.required' => 'Ijin Usaha Wajib diisi!',
|
||||
'ijin_usaha_id.min' => 'Ijin Usaha Wajib diisi minimal satu atau lebih!',
|
||||
'jenis_aset_id.required' => 'Jenis Aset Wajib diisi!',
|
||||
'jenis_aset_id.min' => 'Jenis Aset Wajib diisi minimal satu atau lebih!',
|
||||
'attachment.mimes' => 'Attachment harus berformat pdf!',
|
||||
'attachment.max' => 'Attachment berukuran maksimum 1 MB!',
|
||||
];
|
||||
}
|
||||
|
||||
public function prepareForValidation()
|
||||
{
|
||||
$detailEmailKantor = [];
|
||||
$detailNamaPicReviewer = [];
|
||||
$detailNomorHpPicReviewer = [];
|
||||
$detailNamaPicAdmin = [];
|
||||
$detailNomorHpPicAdmin = [];
|
||||
$detailNamaPicMarketing = [];
|
||||
$detailNomorHpPicMarketing = [];
|
||||
|
||||
// Get input data with safe default values
|
||||
$emailKantor = $this->input('detail_email_kantor.email_kantor', []);
|
||||
$namaPicReviewer = $this->input('detail_nama_pic_reviewer.nama_pic_reviewer', []);
|
||||
$nomorHpPicReviewer = $this->input('detail_nomor_hp_pic_reviewer.nomor_hp_pic_reviewer', []);
|
||||
$namaPicAdmin = $this->input('detail_nama_pic_admin.nama_pic_admin', []);
|
||||
$nomorHpPicAdmin = $this->input('detail_nomor_hp_pic_admin.nomor_hp_pic_admin', []);
|
||||
$namaPicMarketing = $this->input('detail_nama_pic_marketing.nama_pic_marketing', []);
|
||||
$nomorHpPicMarketing = $this->input('detail_nomor_hp_pic_marketing.nomor_hp_pic_marketing', []);
|
||||
|
||||
foreach ($emailKantor as $value) {
|
||||
$detailEmailKantor[] = [
|
||||
'email_kantor' => $value
|
||||
];
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_email_kantor' => json_encode($detailEmailKantor),
|
||||
]);
|
||||
|
||||
foreach ($namaPicReviewer as $value) {
|
||||
$detailNamaPicReviewer[] = [
|
||||
'nama_pic_reviewer' => $value
|
||||
];
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_nama_pic_reviewer' => json_encode($detailNamaPicReviewer),
|
||||
]);
|
||||
|
||||
foreach ($nomorHpPicReviewer as $value) {
|
||||
$detailNomorHpPicReviewer[] = [
|
||||
'nomor_hp_pic_reviewer' => $value
|
||||
];
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_nomor_hp_pic_reviewer' => json_encode($detailNomorHpPicReviewer),
|
||||
]);
|
||||
|
||||
foreach ($namaPicAdmin as $value) {
|
||||
$detailNamaPicAdmin[] = [
|
||||
'nama_pic_admin' => $value
|
||||
];
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_nama_pic_admin' => json_encode($detailNamaPicAdmin),
|
||||
]);
|
||||
|
||||
foreach ($nomorHpPicAdmin as $value) {
|
||||
$detailNomorHpPicAdmin[] = [
|
||||
'nomor_hp_pic_admin' => $value
|
||||
];
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_nomor_hp_pic_admin' => json_encode($detailNomorHpPicAdmin),
|
||||
]);
|
||||
|
||||
foreach ($namaPicMarketing as $value) {
|
||||
$detailNamaPicMarketing[] = [
|
||||
'nama_pic_marketing' => $value
|
||||
];
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_nama_pic_marketing' => json_encode($detailNamaPicMarketing),
|
||||
]);
|
||||
|
||||
foreach ($nomorHpPicMarketing as $value) {
|
||||
$detailNomorHpPicMarketing[] = [
|
||||
'nomor_hp_pic_marketing' => $value
|
||||
];
|
||||
}
|
||||
|
||||
$this->merge([
|
||||
'detail_nomor_hp_pic_marketing' => json_encode($detailNomorHpPicMarketing),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,36 +18,5 @@ class KJPP extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'code',
|
||||
'name',
|
||||
'jenis_kantor',
|
||||
'nomor_ijin_usaha',
|
||||
'province_code',
|
||||
'city_code',
|
||||
'district_code',
|
||||
'village_code',
|
||||
'address',
|
||||
'postal_code',
|
||||
'nomor_telepon_kantor',
|
||||
'email_kantor',
|
||||
'detail_email_kantor',
|
||||
'nama_pimpinan',
|
||||
'nomor_hp_pimpinan',
|
||||
'nama_pic_reviewer',
|
||||
'detail_nama_pic_reviewer',
|
||||
'nomor_hp_pic_reviewer',
|
||||
'detail_nomor_hp_pic_reviewer',
|
||||
'nama_pic_admin',
|
||||
'detail_nama_pic_admin',
|
||||
'nomor_hp_pic_admin',
|
||||
'detail_nomor_hp_pic_admin',
|
||||
'nama_pic_marketing',
|
||||
'detail_nama_pic_marketing',
|
||||
'nomor_hp_pic_marketing',
|
||||
'detail_nomor_hp_pic_marketing',
|
||||
'ijin_usaha_id',
|
||||
'jenis_aset_id',
|
||||
'attachment',
|
||||
];
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user