コード例 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($user_id)
 {
     $user = User::findOrFail($user_id);
     $orders = $user->orders;
     return view('orders.user', compact('orders'));
 }
コード例 #2
0
 /**
  * Handle the command.
  *
  * @param  RegisterCommand  $command
  * @return void
  */
 public function handle(RegisterCommand $command)
 {
     $user = User::register($command->first_name, $command->last_name, $command->email, $command->password, $command->address, $command->city, $command->state, $command->zip_code, $command->country);
     $this->userRepo->persist($user);
 }