19 lines
300 B
PHP
19 lines
300 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Middleware;
|
||
|
|
||
|
use Illuminate\Support\Facades\Auth;
|
||
|
use Closure;
|
||
|
|
||
|
class Reseller
|
||
|
{
|
||
|
public function handle($request, Closure $next)
|
||
|
{
|
||
|
if (! in_array(Auth::user()->role(),['Wholesaler','Reseller']))
|
||
|
{
|
||
|
abort(303,'Not Reseller');
|
||
|
|
||
|
} else
|
||
|
return $next($request);
|
||
|
}
|
||
|
}
|