예제 #1
0
 public function outgoingOrder(Request $request, $id)
 {
     $organization = Organization::findOrFail($id);
     $order = OrganizationOrder::orderBy('created_at', 'desc')->first();
     $message = "Today's lunch will be " . $order->restaurant()->name . "!";
     $message .= " Make sure to <" . route('lineitem.create', [$order->id]) . "|put in your order>!";
     $body = json_encode(['text' => $message]);
     $client = new \GuzzleHttp\Client();
     $res = $client->post($organization->incoming_slack_link, ['body' => $body]);
     return redirect()->route('organization.view', [$organization->id]);
 }