We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54029aa commit 55d6a97Copy full SHA for 55d6a97
src/Darryldecode/Backend/Base/Etc/scaffolds/Controller
@@ -7,9 +7,16 @@ use Darryldecode\Backend\Utility\Helpers;
7
8
class {{componentNamespace}}Controller extends BaseController {
9
10
+ public function __construct()
11
+ {
12
+ parent::__construct();
13
+ $this->middleware('backend.authenticated');
14
+ $this->triggerBeforeBackendHook();
15
+ }
16
+
17
public function index()
18
{
- if( ! $this->user->hasAnyPermission(['{{componentNamespace}}.manage']) )
19
+ if( ! \Auth::user()->hasAnyPermission(['{{componentNamespace}}.manage']) )
20
21
return Helpers::redirectDashboard();
22
}
0 commit comments