コード例 #1
0
ファイル: HomeController.php プロジェクト: NikaBuligini/xo
 public function getRequest(Request $request)
 {
     $auth = auth()->user();
     $match_request = MatchRequest::find($request->match_request_id);
     if (!$match_request || $auth->id != $match_request->target_id) {
         return ['success' => false];
     }
     return $match_request;
 }
コード例 #2
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $match_request = new MatchRequest(['author_id' => $this->auth->id, 'target_id' => $this->target_id]);
     $match_request->save();
     Event::fire(new OnMatchRequest($match_request));
 }