diff --git a/app/DTOs/ContactInfoData.php b/app/DTOs/ContactInfoData.php
new file mode 100644
index 0000000..4b2ba11
--- /dev/null
+++ b/app/DTOs/ContactInfoData.php
@@ -0,0 +1,23 @@
+label,
+ identifier: $contactInfo->identifier,
+ );
+ }
+}
diff --git a/app/Enums/Icons.php b/app/Enums/Icons.php
deleted file mode 100644
index feb856c..0000000
--- a/app/Enums/Icons.php
+++ /dev/null
@@ -1,16 +0,0 @@
- Options::forEnum(Icons::class)->toArray(),
- ]);
+ return inertia("Dashboard/ContactInfo/Create");
}
public function store(ContactInfoRequest $request): RedirectResponse
@@ -47,7 +43,6 @@ public function edit(ContactInfo $contactInfo): Response
{
return inertia("Dashboard/ContactInfo/Edit", [
"contactInfo" => $contactInfo,
- "icons" => Options::forEnum(Icons::class)->toArray(),
]);
}
diff --git a/app/Http/Controllers/Public/ContactController.php b/app/Http/Controllers/Public/ContactController.php
new file mode 100644
index 0000000..6183527
--- /dev/null
+++ b/app/Http/Controllers/Public/ContactController.php
@@ -0,0 +1,30 @@
+first();
+ $contactInfos = ContactInfo::query()->get();
+
+ return inertia("Public/Contact", [
+ "title" => $settings->teacher_titles,
+ "name" => $settings->teacher_name,
+ "email" => $settings->teacher_email,
+ "department" => $settings->department_name,
+ "university" => $settings->university_name,
+ "universityLogo" => asset("cwup-full.png"),
+ "contactInfos" => $contactInfos->map(fn(ContactInfo $contactInfo): ContactInfoData => ContactInfoData::fromModel($contactInfo)),
+ ]);
+ }
+}
diff --git a/app/Http/Requests/ContactInfoRequest.php b/app/Http/Requests/ContactInfoRequest.php
index d70963f..f59510b 100644
--- a/app/Http/Requests/ContactInfoRequest.php
+++ b/app/Http/Requests/ContactInfoRequest.php
@@ -5,8 +5,6 @@
namespace Keating\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
-use Illuminate\Validation\Rules\Enum;
-use Keating\Enums\Icons;
class ContactInfoRequest extends FormRequest
{
@@ -15,7 +13,6 @@ public function rules(): array
return [
"label" => ["required", "string", "max:255"],
"identifier" => ["required", "string", "max:255"],
- "icon" => ["required", new Enum(Icons::class)],
];
}
}
diff --git a/app/Models/ContactInfo.php b/app/Models/ContactInfo.php
index 0796508..3e9147c 100644
--- a/app/Models/ContactInfo.php
+++ b/app/Models/ContactInfo.php
@@ -11,9 +11,8 @@
/**
* @property string $id
- * @property string $email
- * @property string $github_handle
- * @property string $alternative_channel
+ * @property string $label
+ * @property string $identifier
* @property Carbon $created_at
* @property Carbon $updated_at
*/
diff --git a/database/factories/ContactInfoFactory.php b/database/factories/ContactInfoFactory.php
index 6b8cf6a..2cdd47c 100644
--- a/database/factories/ContactInfoFactory.php
+++ b/database/factories/ContactInfoFactory.php
@@ -5,7 +5,6 @@
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
-use Keating\Enums\Icons;
use Keating\Models\ContactInfo;
/**
@@ -18,7 +17,6 @@ public function definition(): array
return [
"label" => fake()->domainWord(),
"identifier" => fake()->url(),
- "icon" => fake()->randomElement(Icons::class),
];
}
}
diff --git a/database/migrations/2024_08_28_073139_remove_icon_field_from_contact_infos_table.php b/database/migrations/2024_08_28_073139_remove_icon_field_from_contact_infos_table.php
new file mode 100644
index 0000000..4b76fe2
--- /dev/null
+++ b/database/migrations/2024_08_28_073139_remove_icon_field_from_contact_infos_table.php
@@ -0,0 +1,23 @@
+dropColumn("icon");
+ });
+ }
+
+ public function down(): void
+ {
+ Schema::table("contact_infos", function (Blueprint $table): void {
+ $table->string("icon")->nullable();
+ });
+ }
+};
diff --git a/resources/js/Pages/Dashboard/ContactInfo/Create.vue b/resources/js/Pages/Dashboard/ContactInfo/Create.vue
index 4440422..39550a1 100644
--- a/resources/js/Pages/Dashboard/ContactInfo/Create.vue
+++ b/resources/js/Pages/Dashboard/ContactInfo/Create.vue
@@ -5,7 +5,6 @@ import SubmitButton from '@/Shared/Components/Buttons/SubmitButton.vue'
import FormGroup from '@/Shared/Forms/FormGroup.vue'
import FormLabel from '@/Shared/Forms/FormLabel.vue'
import TextInput from '@/Shared/Forms/TextInput.vue'
-import Select from '@/Shared/Forms/Select.vue'
import { useForm } from '@inertiajs/inertia-vue3'
import FormError from '@/Shared/Forms/FormError.vue'
import ManagementHeader from '@/Shared/Components/ManagementHeader.vue'
@@ -63,13 +62,6 @@ function createContactInfo() {