From debc5735d6b9c9b6cda8843ce08b75d647326447 Mon Sep 17 00:00:00 2001 From: alissonalbuquerque Date: Tue, 1 Feb 2022 23:26:27 -0300 Subject: [PATCH] =?UTF-8?q?add=20Model=20de=20Unidade,=20add=20altera?= =?UTF-8?q?=C3=A7=C3=B5es=20em=20tabela=20de=20curso=5Fin=5Fusers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Unidade.php | 41 +++++++++++++++++++ ..._02_014728_create_curso_in_users_table.php | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 app/Models/Unidade.php diff --git a/app/Models/Unidade.php b/app/Models/Unidade.php new file mode 100644 index 0000000..3de7ac0 --- /dev/null +++ b/app/Models/Unidade.php @@ -0,0 +1,41 @@ + 'Arcoverde', + self::CARUARU => 'Caruaru', + self::GARANHUNS => 'Garanhuns', + self::NAZARE_DA_MATA => 'Nazaré da Mata', + self::PALMARES => 'Palmares', + self::PETROLINA => 'Petrolina', + self::RECIFE => 'Recife', + self::REGIAO_METROPOLITANA => 'Região Metropolitana', + self::SALGUEIRO => 'Salgueiro', + self::SERRA_TALHADA => 'Serra Talhada', + ]; + + return $value != null? $values[$value] : $values; + } +} diff --git a/database/migrations/2022_02_02_014728_create_curso_in_users_table.php b/database/migrations/2022_02_02_014728_create_curso_in_users_table.php index 4ac5bd7..2314042 100644 --- a/database/migrations/2022_02_02_014728_create_curso_in_users_table.php +++ b/database/migrations/2022_02_02_014728_create_curso_in_users_table.php @@ -26,7 +26,7 @@ class CreateCursoInUsersTable extends Migration public function down() { if(Schema::hasColumn('users', 'curso_id')) { - Schema::dropColumns('curso_id'); + Schema::dropColumns('users', ['curso_id']); } } } -- GitLab