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
submeta
Commits
02ed9244
"database/seeders/DatabaseSeeder.php" did not exist on "99a9b2bb3f3220e1ca971af267b396ebfcc4ec2f"
Commit
02ed9244
authored
Jun 18, 2021
by
José Rômulo
Browse files
Adicionando checkCoordenador
parent
968e035f
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Middleware/checkCoordenador.php
0 → 100644
View file @
02ed9244
<?php
namespace
App\Http\Middleware
;
use
Auth
;
use
Closure
;
use
Illuminate\Support\Facades\Log
;
class
checkCoordenador
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public
function
handle
(
$request
,
Closure
$next
)
{
if
(
!
Auth
::
check
()){
Log
::
debug
(
'checkCoordenador'
);
return
redirect
(
'/'
);
}
if
(
Auth
::
user
()
->
tipo
==
'coordenador'
){
return
$next
(
$request
);
}
else
{
return
redirect
(
'home'
)
->
with
(
'error'
,
'Você não possui privilégios para acessa esta funcionalidade'
);
}
}
}
\ 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