Skip to content

Commit 55d6a97

Browse files
committed
patch on scalfolding of controller...
1 parent 54029aa commit 55d6a97

File tree

1 file changed

+8
-1
lines changed
  • src/Darryldecode/Backend/Base/Etc/scaffolds

1 file changed

+8
-1
lines changed

src/Darryldecode/Backend/Base/Etc/scaffolds/Controller

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ use Darryldecode\Backend\Utility\Helpers;
77

88
class {{componentNamespace}}Controller extends BaseController {
99

10+
public function __construct()
11+
{
12+
parent::__construct();
13+
$this->middleware('backend.authenticated');
14+
$this->triggerBeforeBackendHook();
15+
}
16+
1017
public function index()
1118
{
12-
if( ! $this->user->hasAnyPermission(['{{componentNamespace}}.manage']) )
19+
if( ! \Auth::user()->hasAnyPermission(['{{componentNamespace}}.manage']) )
1320
{
1421
return Helpers::redirectDashboard();
1522
}

0 commit comments

Comments
 (0)