/**
  * Store a newly created Location in storage.
  *
  * @param CreateLocationRequest $request
  *
  * @return Response
  */
 public function store(CreateLocationRequest $request)
 {
     $input = $request->all();
     $location = $this->locationRepository->create($input);
     Flash::success('Location saved successfully.');
     return redirect(route('locations.index'));
 }
示例#2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, Requests\CreateLocationRequest $request)
 {
     //
     $location = \App\Location::findOrFail($id);
     $input = $request->all();
     \Session::flash('flash_message', 'location ' . $location->name . ' updated.');
     // update
     $location->update($input);
     return redirect('locations/' . $location->id);
 }