Commit fa48bf89 by rizky

routing, handler

parent 71ac3c12
...@@ -5,6 +5,7 @@ namespace App\Exceptions; ...@@ -5,6 +5,7 @@ namespace App\Exceptions;
use Exception; use Exception;
use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
...@@ -44,6 +45,12 @@ class Handler extends ExceptionHandler ...@@ -44,6 +45,12 @@ class Handler extends ExceptionHandler
*/ */
public function render($request, Exception $exception) public function render($request, Exception $exception)
{ {
if($exception instanceof NotFoundHttpException)
{
return response()->view('errors.404', [], 404);
}
return parent::render($request, $exception); return parent::render($request, $exception);
} }
......
...@@ -20,6 +20,7 @@ class RegistrationController extends Controller ...@@ -20,6 +20,7 @@ class RegistrationController extends Controller
'first_name' => 'required|max:255', 'first_name' => 'required|max:255',
'last_name' => 'required|max:255', 'last_name' => 'required|max:255',
'password' => 'confirmed|required|min:6', 'password' => 'confirmed|required|min:6',
'password_confirmation' => 'confirmed|required|same:password'
]); ]);
$user = Sentinel::registerAndActivate($request->all()); $user = Sentinel::registerAndActivate($request->all());
......
...@@ -19,6 +19,6 @@ class CustomerMiddleware ...@@ -19,6 +19,6 @@ class CustomerMiddleware
if(Sentinel::check() && Sentinel::getUser()->roles()->first()->slug=='customer') if(Sentinel::check() && Sentinel::getUser()->roles()->first()->slug=='customer')
return $next($request); return $next($request);
else else
return redirect('/'); return redirect()->back();
} }
} }
...@@ -19,6 +19,6 @@ class ManagerMiddleware ...@@ -19,6 +19,6 @@ class ManagerMiddleware
if(Sentinel::check() && Sentinel::getUser()->roles()->first()->slug=='manager') if(Sentinel::check() && Sentinel::getUser()->roles()->first()->slug=='manager')
return $next($request); return $next($request);
else else
return redirect('/'); return redirect()->back();
} }
} }
...@@ -19,6 +19,6 @@ class StaffMiddleware ...@@ -19,6 +19,6 @@ class StaffMiddleware
if(Sentinel::check() && Sentinel::getUser()->roles()->first()->slug=='staff') if(Sentinel::check() && Sentinel::getUser()->roles()->first()->slug=='staff')
return $next($request); return $next($request);
else else
return redirect('/'); return redirect()->back();
} }
} }
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<div class="separator"> <div class="separator">
<p class="change_link">Already a member ? <p class="change_link">Already a member ?
<a href="{{url('/register')}}" class="to_register"> Log in </a> <a href="{{url('/login')}}" class="to_register"> Log in </a>
</p> </p>
<div class="clearfix"></div> <div class="clearfix"></div>
......
...@@ -16,18 +16,13 @@ ...@@ -16,18 +16,13 @@
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h2>Jumlah Pesanan</h2> <h2>Jumlah Pesanan</h2>
<ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
</li>
</ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> <div class="x_content">
<form action="{{url('/ticket/beli/')}}" method="post"> <form action="{{url('/ticket/beli/')}}" method="post">
{{ csrf_field() }} {{ csrf_field() }}
<label class="col-md-4 control-label">User ID</label> <label class="col-md-4 control-label">User ID</label>
<input type="text" value="{{Sentinel::getUser()->id}}" class="form-control" name="user_id" readonly> <input type="text" value="{{Sentinel::getUser()->id}}" class="form-control" name="user_id" readonly>
<label class="col-md-4 control-label">Name</label> <label class="col-md-4 control-label">Name</label>
......
...@@ -33,14 +33,7 @@ ...@@ -33,14 +33,7 @@
<!-- price element --> <!-- price element -->
<div class="col-md-4 col-sm-6 col-xs-12" style="align-content: center"> <div class="col-md-4 col-sm-6 col-xs-12" style="align-content: center">
<div class="pricing ui-ribbon-container">
<div class="ui-ribbon-wrapper">
</div>
<div class="title">
</div>
<div class="x_content">
</div>
</div>
</div> </div>
<!-- price element --> <!-- price element -->
...@@ -80,14 +73,7 @@ ...@@ -80,14 +73,7 @@
<!-- price element --> <!-- price element -->
<div class="col-md-4 col-sm-6 col-xs-12" style="align-content: center"> <div class="col-md-4 col-sm-6 col-xs-12" style="align-content: center">
<div class="pricing ui-ribbon-container">
<div class="ui-ribbon-wrapper">
</div>
<div class="title">
</div>
<div class="x_content">
</div>
</div>
</div> </div>
<!-- price element --> <!-- price element -->
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TB Silalahi Center</title>
<!-- Bootstrap -->
<link href="{{asset('../vendors/bootstrap/dist/css/bootstrap.min.css')}}" rel="stylesheet">
<!-- Font Awesome -->
<link href="{{asset('../vendors/font-awesome/css/font-awesome.min.css')}}" rel="stylesheet">
<!-- NProgress -->
<link href="{{asset('../vendors/nprogress/nprogress.css')}}" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="{{asset('../build/css/custom.min.css')}}" rel="stylesheet">
</head>
<body class="nav-md">
<div class="container body">
<div class="main_container">
<!-- page content -->
<div class="col-md-12">
<div class="col-middle">
<div class="text-center text-center">
<h1 class="error-number">404</h1>
<h2>Sorry but we couldn't find this page</h2>
<p>This page you are looking for does not exist</p>
<h1>Halaman tidak ditemukan</h1>
</div>
</div>
</div>
<!-- /page content -->
</div>
</div>
<!-- jQuery -->
<script src="{{asset('../vendors/jquery/dist/jquery.min.js')}}"></script>
<!-- Bootstrap -->
<script src="{{asset('../vendors/bootstrap/dist/js/bootstrap.min.js')}}"></script>
<!-- FastClick -->
<script src="{{asset('../vendors/fastclick/lib/fastclick.js')}}"></script>
<!-- NProgress -->
<script src="{{asset('../vendors/nprogress/nprogress.js')}}"></script>
<!-- Custom Theme Scripts -->
<script src="{{asset('../build/js/custom.min.js')}}"></script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment