public function update(Request $request, $id)
 {
     $customer = Customer::whereId($id)->first();
     $customer->fill($request->all());
     $customer->push();
     return redirect('/customer/' . $id . '/show')->with('status', Alert::get('success', 'Informationen är uppdaterad.'));
 }
Beispiel #2
0
 public function save(Request $request)
 {
     if (!User::exists($request->email) && $request->password == $request->password_again) {
         $user = new User();
         $user->password = Hash::make($request->password);
         $user->name = $request->name;
         $user->email = $request->email;
         $user->group_id = $request->group_id;
         $user->save();
         return redirect('/')->with("status", Alert::get("success", $user->name . " kan nu logga in."));
     }
     return redirect('/admin/create_user')->with("status", Alert::get("danger", "Krav för form stämmer inte överens. Kontrollera: Email, lösenord"));
 }
Beispiel #3
0
 public function save(Request $request)
 {
     if (Customer::whereCustomer_id($request->customer_id)->first()) {
         $order = Order::create($request->all());
         $order->user_id = Auth::user()->id;
         $event = new Event();
         $event->title = $request->title;
         $event->start = $request->booked_at;
         $event->order_id = $request->order_id;
         $end = date_create($request->booked_at);
         date_add($end, date_interval_create_from_date_string($request->estimated_time . ' hours'));
         $event->end = date_format($end, 'Y-m-d H:i');
         $order->save();
         $event->save();
         $order->event_id = $event->id;
         $order->push();
         return redirect('/order/' . $order->id . '/show');
     }
     return redirect('/order/create')->with("session", Alert::get("danger", "Något gick snett.. Försök igen!"));
 }
 /**
  * Sparar en ny artikel
  * @param  Request $request 
  * @return articles.blade.php
  */
 public function save(Request $request)
 {
     ArticlesList::create($request->all());
     return redirect('/article')->with("status", Alert::get("success", "Du har skapat en artikel."));
 }
Beispiel #5
0
 public function file(Request $request)
 {
     $tire = Tire::create($request->all());
     return redirect("/tire")->with("status", Alert::get("success", "Du har lämnat in däck för kunden <b>" . $tire->customer()->first()->name . '</b>'));
 }
Beispiel #6
0
 public function getLabelForReputation()
 {
     return Alert::getLabel($this->getStatusByReputation()['status'], $this->getStatusByReputation()['message']);
 }