v0.10.15h - Fixed admin access
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Jenssegers\Agent\Facades\Agent;
|
||||
|
||||
@@ -28,8 +29,12 @@ class DetectorServiceProvider extends ServiceProvider
|
||||
Response::macro("detect", function ($view, $args = []) {
|
||||
if(Agent::isMobile()) {
|
||||
return view(config("detector.mobilePath") . "." . $view, $args);
|
||||
} else if(Auth()->user() !== null){
|
||||
if(Auth()->user()->can('admin.panel.show') == true)
|
||||
return view(config("detector.defaultPath") . "." . $view, $args);
|
||||
}
|
||||
return view(config("detector.defaultPath") . "." . $view, $args);
|
||||
|
||||
return view(config("detector.mobilePath") . "." . $view, $args);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user