Ejemplo n.º 1
0
 public function showWelcome()
 {
     Auth::login(User::find(1));
     dd(Auth::user()->hasMtmRole(Role::findByName('Agency Admin')));
     dd(Agency::findByName('Dietrich, Koelpin and Weissnat'));
     $model = Agency::first();
     echo $model->hasMtmUser(User::find(1), 'admins');
     // dd($this->get_class());
     // dd($this->getActionPermissions(get_class($this)));
     // return View::make('hello');
 }
Ejemplo n.º 2
0
 public function claim()
 {
     Log::info('Inside Claim');
     Log::info(Input::all());
     $code = trim(Input::get('code'));
     $user_type = trim(Input::get('user_type'));
     $password = trim(Input::get('password'));
     $confirm_password = trim(Input::get('confirm_password'));
     $invite = Invite::where('code', '=', trim($code))->where('user_type', '=', $user_type)->where('claimed_at', '=', null)->first();
     if ($invite && $password == $confirm_password) {
         $user = User::find($invite->user_id);
         $user->password = $password;
         $user->confirmed = 1;
         $user->save();
         $this->respondWithArray(['success' => true, 'message' => 'Password Updated successfully. You can now login.']);
     } else {
         $this->respondWithArray(['success' => false, 'message' => 'Please make sure you clicked on the correct link and you put two identical password.']);
     }
 }
Ejemplo n.º 3
0
 /**
  * List Jobs
  * @return \Illuminate\Http\JsonResponse
  */
 public function jobs($candidateId)
 {
     $candidate = Candidate::findOrFail($candidateId);
     $user = User::find($candidate->user_id);
     $jobs = $user->jobsAppliedTo()->with('skills')->paginate();
     return $this->respondWithCollection($jobs, new JobTransformer(), ['skills']);
 }