migrate to gtea from bistbucket
This commit is contained in:
27
public/restaurant/app/Http/Middleware/Customer.php
Normal file
27
public/restaurant/app/Http/Middleware/Customer.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Traits\ResponseTrait;
|
||||
use Closure;
|
||||
|
||||
class Customer
|
||||
{
|
||||
use ResponseTrait;
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
// Check if the authenticated user is not a Customer
|
||||
if (auth()->user()->user_type != 'Customer') {
|
||||
return $this->responseError([], _lang('You are not authorized to access this feature!'), 403);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user