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
fbaa1a02
"...naturezas/git@sites.upe.br:walter.felipe/submeta.git" did not exist on "c6fe42740b5471afcfa6ed34453c88077a46961c"
Commit
fbaa1a02
authored
Mar 13, 2022
by
Abraão Barbosa
Browse files
Merge branch 'main' of
https://github.com/alissonalbuquerque/pad-upe
parents
d0baf467
6ba8af32
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Models/Campus.php
View file @
fbaa1a02
...
@@ -21,6 +21,23 @@ class Campus extends Model
...
@@ -21,6 +21,23 @@ class Campus extends Model
*
*
* @var array
* @var array
*/
*/
protected
$fillable
=
[
'name'
,
'unidade'
];
protected
$fillable
=
[
'name'
,
'unidade
_id
'
];
/**
* Get Unidade with unidade.id = campus.unidade_id
*
* @return Unidade
*/
public
function
unidade
()
{
return
$this
->
belongsTo
(
Unidade
::
class
);
}
/**
* @return string
*/
public
function
__toString
()
{
return
$this
->
name
;
}
}
}
app/Models/Curso.php
View file @
fbaa1a02
...
@@ -23,5 +23,23 @@ class Curso extends Model
...
@@ -23,5 +23,23 @@ class Curso extends Model
*/
*/
protected
$fillable
=
[
'name'
,
'campus_id'
];
protected
$fillable
=
[
'name'
,
'campus_id'
];
/**
* Get Campus with campus.id = curso.campus_id
*
* @return Campus
*/
public
function
campus
()
{
return
$this
->
belongsTo
(
Campus
::
class
);
}
/**
* @return string
*/
public
function
__toString
()
{
return
$this
->
name
;
}
}
}
app/Models/User.php
View file @
fbaa1a02
...
@@ -12,8 +12,10 @@ class User extends Authenticatable
...
@@ -12,8 +12,10 @@ class User extends Authenticatable
{
{
use
HasApiTokens
,
HasFactory
,
Notifiable
;
use
HasApiTokens
,
HasFactory
,
Notifiable
;
const
TYPE_MENAGER
=
1
;
const
TYPE_ADMIN
=
1
;
// Administrador
const
TYPE_TEACHER
=
2
;
const
TYPE_TEACHER
=
2
;
// Professor
const
TYPE_MANAGER
=
3
;
// Diretor
const
TYPE_COORDINATOR
=
4
;
// Coordenador
const
STATUS_ACTIVE
=
1
;
const
STATUS_ACTIVE
=
1
;
const
STATUS_INACTIVE
=
2
;
const
STATUS_INACTIVE
=
2
;
...
@@ -26,7 +28,7 @@ class User extends Authenticatable
...
@@ -26,7 +28,7 @@ class User extends Authenticatable
*
*
* @var array<int, string>
* @var array<int, string>
*/
*/
protected
$fillable
=
[
'name'
,
'email'
,
'password'
,
'document'
,
'type'
,
'status'
,
'unidade'
];
protected
$fillable
=
[
'name'
,
'email'
,
'password'
,
'document'
,
'type'
,
'status'
,
'curso_id'
,
'unidade
_id
'
];
/**
/**
* The attributes that should be hidden for serialization.
* The attributes that should be hidden for serialization.
...
@@ -43,4 +45,33 @@ class User extends Authenticatable
...
@@ -43,4 +45,33 @@ class User extends Authenticatable
protected
$casts
=
[
protected
$casts
=
[
'email_verified_at'
=>
'datetime'
'email_verified_at'
=>
'datetime'
];
];
/**
* Get Curso with curso.id = user.curso_id
*
* @return Curso|null
*/
public
function
curso
()
{
return
$this
->
belongsTo
(
Curso
::
class
);
}
/**
* Get Unidade with unidade.id = user.unidade_id
*
* @return Unidade|null
*/
public
function
unidade
()
{
return
$this
->
belongsTo
(
Unidade
::
class
);
}
/**
* @return string
*/
public
function
__toString
()
{
return
$this
->
name
;
}
}
}
resources/views/layouts/main.blade.php
0 → 100644
View file @
fbaa1a02
<!DOCTYPE html>
<html
lang=
"pt-br"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<!-- Bootstrap CSS -->
<link
rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity=
"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin=
"anonymous"
>
<!-- Font Awesome -->
<link
rel=
"stylesheet"
href=
"https://use.fontawesome.com/releases/v5.15.4/css/all.css"
integrity=
"sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm"
crossorigin=
"anonymous"
/>
<title>
@yield('title')
</title>
</head>
<body>
@section('body')
@show
@section('script')
@show
<!-- jQuery, Popper.js and Bootstrap JS -->
<script
src=
"https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity=
"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity=
"sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin=
"anonymous"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity=
"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin=
"anonymous"
></script>
</body>
</html>
\ No newline at end of file
routes/web.php
View file @
fbaa1a02
<?php
<?php
use
App\Http\Controllers\CampusController
;
use
App\Http\Controllers\CursoController
;
use
App\Http\Controllers\UnidadeController
;
use
Illuminate\Support\Facades\Route
;
use
Illuminate\Support\Facades\Route
;
/*
/*
...
@@ -13,12 +16,28 @@ use Illuminate\Support\Facades\Route;
...
@@ -13,12 +16,28 @@ use Illuminate\Support\Facades\Route;
|
|
*/
*/
require
__DIR__
.
'/auth.php'
;
Route
::
get
(
'/'
,
function
()
{
Route
::
get
(
'/'
,
function
()
{
return
view
(
'auth/
login'
);
return
redirect
()
->
route
(
'
login'
);
});
});
Route
::
get
(
'/dashboard'
,
function
()
{
Route
::
get
(
'/dashboard'
,
function
()
{
return
view
(
'dashboard'
);
return
view
(
'dashboard'
);
})
->
middleware
([
'auth'
])
->
name
(
'dashboard'
);
})
->
middleware
([
'auth'
])
->
name
(
'dashboard'
);
require
__DIR__
.
'/auth.php'
;
Route
::
get
(
'/campus/index'
,
[
CampusController
::
class
,
'index'
])
->
name
(
'campus_index'
);
Route
::
get
(
'/campus/create'
,
[
CampusController
::
class
,
'create'
])
->
name
(
'campus_create'
);
Route
::
post
(
'/campus/store'
,
[
CampusController
::
class
,
'store'
])
->
name
(
'campus_store'
);
Route
::
get
(
'/unidade/index'
,
[
UnidadeController
::
class
,
'index'
])
->
name
(
'unidade_index'
);
Route
::
get
(
'/unidade/create'
,
[
UnidadeController
::
class
,
'create'
])
->
name
(
'unidade_create'
);
Route
::
post
(
'/unidade/store'
,
[
UnidadeController
::
class
,
'store'
])
->
name
(
'unidade_store'
);
Route
::
get
(
'/unidade/edit/{id}'
,
[
UnidadeController
::
class
,
'edit'
])
->
name
(
'unidade_edit'
);
Route
::
post
(
'/unidade/update/{id}'
,
[
UnidadeController
::
class
,
'update'
])
->
name
(
'unidade_update'
);
Route
::
delete
(
'/unidade/delete/{id}'
,
[
UnidadeController
::
class
,
'destroy'
])
->
name
(
'unidade_delete'
);
Route
::
get
(
'/curso/index'
,
[
CursoController
::
class
,
'index'
])
->
name
(
'curso_index'
);
Route
::
get
(
'/curso/create'
,
[
CursoController
::
class
,
'create'
])
->
name
(
'curso_create'
);
Route
::
post
(
'/curso/store'
,
[
CursoController
::
class
,
'store'
])
->
name
(
'curso_store'
);
\ No newline at end of file
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