/**
  * 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 del_client_access($id, $id_user)
 {
     // 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
     $user_acc = AccessClient::find($id_user);
     $user_acc->delete();
     Alert::success('Berhasil menghapus access ');
     return redirect('project/' . $id . '/client_access');
 }