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
983c2ceb
"resources/views/git@sites.upe.br:walter.felipe/submeta.git" did not exist on "3b30c761c5c5e0b342efe542ddc4395645434e20"
Commit
983c2ceb
authored
Mar 11, 2022
by
alissonalbuquerque
Browse files
add model de Unidade
parent
22696224
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Models/Unidade.php
View file @
983c2ceb
...
...
@@ -5,37 +5,30 @@ 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
* References table unidade
*
* @var 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'
,
];
protected
$table
=
"unidade"
;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected
$fillable
=
[
'name'
];
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
/**
* @return string
*/
public
function
__toString
()
{
return
$this
->
name
;
}
}
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