Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
debc5735
Commit
debc5735
authored
Feb 01, 2022
by
alissonalbuquerque
Browse files
add Model de Unidade, add alterações em tabela de curso_in_users
parent
8ba7f64f
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Models/Unidade.php
0 → 100644
View file @
debc5735
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
Unidade
extends
Model
{
const
ARCOVERDE
=
1
;
const
CARUARU
=
2
;
const
GARANHUNS
=
3
;
const
NAZARE_DA_MATA
=
4
;
const
PALMARES
=
5
;
const
PETROLINA
=
6
;
const
RECIFE
=
7
;
const
REGIAO_METROPOLITANA
=
8
;
const
SALGUEIRO
=
9
;
const
SERRA_TALHADA
=
10
;
/**
* @param integer $value
* @return array|string
*/
public
static
function
listUnidades
(
$value
=
null
)
{
$values
=
[
self
::
ARCOVERDE
=>
'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
;
}
}
database/migrations/2022_02_02_014728_create_curso_in_users_table.php
View file @
debc5735
...
...
@@ -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'
]
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment