예제 #1
0
 /**
  * Remove the user.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, Request $request)
 {
     $user = User::findOrFail($id);
     $user->delete();
     $request->session()->flash('status', $user->name . ' has been deleted!');
     return redirect()->route('users.index');
 }
예제 #2
0
파일: toto.php 프로젝트: DoSomething/toto
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     // Get every user.
     $users = User::getUsers();
     // Get the message.
     foreach ($users as $user) {
         $message = Message::getMessage($user);
         $client = new \GuzzleHttp\Client(['base_uri' => 'http://localhost:3001']);
         // Send a request to the node server to post the message.
         $client->request('POST', '/post', ['json' => ['user' => $user, 'message' => $message]]);
     }
 }