diff --git a/app/Http/Controllers/Dashboard/CompanyController.php b/app/Http/Controllers/Dashboard/CompanyController.php index 6aad86f..0cf375a 100644 --- a/app/Http/Controllers/Dashboard/CompanyController.php +++ b/app/Http/Controllers/Dashboard/CompanyController.php @@ -131,6 +131,7 @@ public function update(CompanyRequest $request){ 'name' => $validatedData['company_name'], 'email' => $validatedData['company_email'], 'address' => $validatedData['company_address'], + 'phone_number' => $validatedData['company_phone_number'], 'director_name' => $validatedData['company_director_name'], 'director_nik' => $validatedData['company_director_nik'], 'director_nik_doc' => $companyFileNames['company_director_nik_doc'], diff --git a/app/Http/Requests/CompanyRequest.php b/app/Http/Requests/CompanyRequest.php index ca76020..85fc76f 100644 --- a/app/Http/Requests/CompanyRequest.php +++ b/app/Http/Requests/CompanyRequest.php @@ -25,6 +25,7 @@ public function rules(): array return [ 'company_name' => ['required', 'max:100'], 'company_email' => ['required', 'max:100', 'email'], + 'company_phone_number' => ['required', 'max:15'], 'company_address' => ['required'], 'company_director_name' => ['required', 'max:100'], 'company_director_nik' => ['required', 'max:100'], @@ -56,6 +57,8 @@ public function messages(): array 'company_email.required' => 'Email perusahaan wajib diisi.', 'company_email.email' => 'Email perusahaan tidak valid.', 'company_email.max' => 'Email perusahaan maksimal 100 karakter.', + 'company_phone_number.required' => 'Nomor telepon perusahaan wajib diisi.', + 'company_phone_number.max' => 'Nomor telepon perusahaan maksimal 15 karakter.', 'company_address.required' => 'Alamat perusahaan wajib diisi.', 'company_director_name.required' => 'Nama direktur perusahaan wajib diisi.', 'company_director_name.max' => 'Nama direktur perusahaan maksimal 100 karakter.', diff --git a/app/Models/Company.php b/app/Models/Company.php index 32cec96..ccc7de4 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -13,6 +13,7 @@ class Company extends Model protected $fillable = [ 'name', 'email', + 'phone_number', 'address', 'director_name', 'director_nik', diff --git a/database/migrations/2025_07_01_104915_add_column_phone_number_to_companies_table.php b/database/migrations/2025_07_01_104915_add_column_phone_number_to_companies_table.php new file mode 100644 index 0000000..7228f3c --- /dev/null +++ b/database/migrations/2025_07_01_104915_add_column_phone_number_to_companies_table.php @@ -0,0 +1,28 @@ +string('phone_number')->nullable()->after('email'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('companies', function (Blueprint $table) { + $table->dropColumn('phone_number'); + }); + } +}; diff --git a/resources/views/dashboard/companies/edit.blade.php b/resources/views/dashboard/companies/edit.blade.php index a6d0497..9333587 100644 --- a/resources/views/dashboard/companies/edit.blade.php +++ b/resources/views/dashboard/companies/edit.blade.php @@ -53,6 +53,14 @@ +