public function userStore(Request $request)
 {
     $content = $request->all();
     if (!$this->userService->create($content)) {
         // User was not created
         return view('installation.user');
     }
     // Success
     $this->installationService->setInstalled(true);
     return redirect('/');
 }
Beispiel #2
0
 public function googleCallback(UserService $userService)
 {
     $google_info = Socialite::with('google')->user();
     $google_id = (int) $google_info->getId();
     //DBからメールアドレスが一致したユーザー情報を取得
     $user = DB::table('users')->where('google_id', $google_id)->first();
     //既に一致するユーザーがいない場合
     if (!$user) {
         $user = $userService->createUser($google_info);
     }
     Session::put('auth', $user->id);
     return redirect('/');
 }
Beispiel #3
0
 /**
  * トップページ
  * @Get("/", as="articles.getIndex")
  * @Middleware("analysis")
  * @param Request $request
  * @return \Illuminate\Http\Response
  */
 public function getIndex(Request $request)
 {
     $param['conditions'] = $request->all();
     $param['userId'] = $this->userService->getUserId($request);
     $param['articles'] = $this->articleService->get($param['conditions']);
     //同じphpを起動している他のプロセスを探し
     exec("ps aux|grep [a]rtisan", $output, $result);
     $isActiveQueueListen = true;
     if (count($output) === 0) {
         $isActiveQueueListen = false;
     }
     $param['isActiveQueueListen'] = $isActiveQueueListen;
     return view('article.index', $param);
 }
Beispiel #4
0
 protected function getUser(UserService $userService)
 {
     $id = Session::get('auth');
     $user = $userService->getUser($id);
     return $user;
 }