/** * Display a listing of the resource. * * @return Response */ public function index() { $data = Employee::all(); $name = Auth::user()->name; $pos = ProjectOfficer::all(); $adms = Admin::all(); $tls = Teamleader::all(); $mems = Member::all(); $proj = Project::all(); $ac = Auth::user()->id; $acc = AccessClient::where('id_users', $ac)->get(); return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('projs', $proj)->with('accss', $acc)->with('datas', $data); }
public function client_access($id) { // Start Check Authorization /** * 1. FullAccess - 1 * 2. HRD - 3 * 3. Creator - 5 * 4. Handler - 7 */ $invalid_auth = 1; $authRole = Auth::user()->UserRoles->role; if ($authRole == 1 or $authRole == 3) { $invalid_auth = 0; } if ($invalid_auth == 1) { Alert::error('Anda tidak memilik akses ini')->persistent('close'); return redirect('project/view/' . $id); } // End Check Authorization $projects = Project::find($id); $user = User::all(); $access = AccessClient::where('id_projects', $id)->get(); return View('dropmin/project/client_access')->with('project', $projects)->with('user', $user)->with('access', $access); }