/** * Remove the specified resource from storage. * * @param int $id ID * * @return \Illuminate\Http\Response */ public function destroy($id) { $module = new Module(); $results = $module->deleteData($id); if (!$results) { return redirect()->route('cpanel.module.index')->with('status', 'fail')->with('msg', trans('cpanel_alert.not_delete')); } else { return redirect()->route('cpanel.module.index')->with('status', 'success')->with('msg', trans('cpanel_alert.successfully')); } }
/** * Run the database seeds. */ public function run() { DB::table('modules')->truncate(); Module::create(['id' => 1, 'name' => 'Management Static page', 'route_key' => 'staticpage']); Module::create(['id' => 2, 'name' => 'Management Services', 'route_key' => 'service']); Module::create(['id' => 3, 'name' => 'Management Timeline', 'route_key' => 'timeline']); Module::create(['id' => 4, 'name' => 'Management Team', 'route_key' => 'team']); Module::create(['id' => 5, 'name' => 'Management Member', 'route_key' => 'member']); Module::create(['id' => 6, 'name' => 'Management Contact', 'route_key' => 'contact']); Module::create(['id' => 7, 'name' => 'Management Group user', 'route_key' => 'groupuser']); Module::create(['id' => 8, 'name' => 'Management User', 'route_key' => 'user']); Module::create(['id' => 9, 'name' => 'Management Language', 'route_key' => 'languages']); Module::create(['id' => 10, 'name' => 'Configuration', 'route_key' => 'config']); }
public function index(Router $router) { // $routeCollection = $router->getRoutes(); // foreach ($routeCollection as $value) { // echo $value->getPath().'<br>'; // } // dd(); dd(Module::select(['name', 'route_key'])->get()->toArray()); $title = 'Dashboard'; $users = User::count(); $static_page = StaticPage::count(); $services = Service::count(); $members = Member::count(); $contacts = Contact::count(); return view('admin.dashboard.index', compact('title', 'users', 'static_page', 'services', 'members', 'contacts')); }
/** * Get Link Module * * @return json */ public function listModules() { $modules = \App\Admin\Module::all(); return json_encode($modules); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request Request * * @return \Illuminate\Http\Response */ public function update(Request $request) { $modules = Module::with('actions')->get(); $role_id = $request->route('groupuser'); $roles = new Role(); $role = $roles->find($role_id); $permission = $role->permissions()->get(); $array_permission = array(); foreach ($permission as $value) { $array_permission[] = $value->permission_slug; } $action_configs = \Config::get('action'); return view('admin.user.updategroup', compact('modules', 'role', 'array_permission', 'action_configs')); }