diff --git a/app/Domains/AcademicProgram/AcademicProgram.php b/app/Domains/AcademicProgram/AcademicProgram.php index 4f72bc6..9fff9dc 100644 --- a/app/Domains/AcademicProgram/AcademicProgram.php +++ b/app/Domains/AcademicProgram/AcademicProgram.php @@ -46,10 +46,10 @@ public static function getVersions($academicProgram = null): array public static function getTypes(): array { return [ - 'Found' => 'Foundation', + 'Foundation' => 'Foundation', 'Core' => 'Core', 'GE' => 'General Elective', 'TE' => 'Technical Elective' ]; } -} +} \ No newline at end of file diff --git a/app/Http/Livewire/Backend/CreateCourses.php b/app/Http/Livewire/Backend/CreateCourses.php index 151786f..f0376db 100644 --- a/app/Http/Livewire/Backend/CreateCourses.php +++ b/app/Http/Livewire/Backend/CreateCourses.php @@ -82,7 +82,7 @@ public function messages() 'semester.required' => 'Please select a semester.', 'version.required' => 'Please provide a curriculum.', 'type.required' => 'Please select a course type.', - 'type.in' => 'The course type must be Core, GE, or TE.', + 'type.in' => 'The course type must be Foundation, Core, GE, or TE.', 'code.required' => 'Please provide a course code.', 'code.unique' => 'This course code is already in use.', 'name.required' => 'Please provide a course name.', diff --git a/app/Http/Livewire/Backend/EditCourses.php b/app/Http/Livewire/Backend/EditCourses.php index aef2a9b..4e8a4fa 100644 --- a/app/Http/Livewire/Backend/EditCourses.php +++ b/app/Http/Livewire/Backend/EditCourses.php @@ -86,7 +86,7 @@ public function messages() 'semester.required' => 'Please select a semester.', 'version.required' => 'Please provide a curriculum.', 'type.required' => 'Please select a course type.', - 'type.in' => 'The course type must be Core, GE, or TE.', + 'type.in' => 'The course type must be Foundation, Core, GE, or TE.', 'code.required' => 'Please provide a course code.', 'name.required' => 'Please provide a course name.', 'credits.required' => 'Please specify the number of credits.', diff --git a/database/migrations/2024_11_06_000554_alter_course_type_enum_column_update.php b/database/migrations/2024_11_06_000554_alter_course_type_enum_column_update.php new file mode 100644 index 0000000..98cbd45 --- /dev/null +++ b/database/migrations/2024_11_06_000554_alter_course_type_enum_column_update.php @@ -0,0 +1,31 @@ +getDriverName() !== 'sqlite') { + $enumValues = "'" . implode("', '", array_keys(Course::getTypes())) . "'"; + DB::statement("ALTER TABLE courses MODIFY COLUMN type ENUM($enumValues)"); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // Nothing here + } +} \ No newline at end of file