osb/app/Http/Middleware/Reseller.php
2018-07-17 14:10:40 +10:00

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);
}
}