/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $donate = Donate::find($id);
     $donate_text = $request->get('donate');
     $donate->donate = $donate_text;
     $donate->save();
     flash()->success('', 'Pakeista parama');
     return redirect()->back();
 }
 /**
  * save the things form
  * @return string(success)
  */
 public function saveThingsForm(Request $request)
 {
     DB::connection()->enableQueryLog();
     $things = new Thing();
     $donate = new Donate();
     $donate->donorId = Auth::user()->user_id;
     $donate->moneyId = 0;
     $donate->thingId = $request->input('id');
     $donate->problemId = $request->input('id');
     $donate->save();
     $things->name = $request->input('name');
     $things->location = $request->input('address');
     $things->description = $request->input('description');
     $things->quantity = $request->input('quantity');
     $things->problemId = $request->input('id');
     $things->save();
     $query = DB::getQueryLog();
     //return print_r($query);
     return "done";
 }
 private function composeDonations()
 {
     view()->composer('layout', function ($view) {
         $view->with('donation', Donate::first());
     });
 }
 /**
  * save the things form
  * @return string(success)
  */
 public function saveThingsForm(Request $request)
 {
     $things = new Thing();
     $donate = new Donate();
     $donate->donorId = Auth::user()->id;
     $donate->moneyId = 0;
     $donate->thingId = $request->input('id');
     $donate->save();
     $things->name = $request->input('name');
     $things->location = $request->input('address');
     $things->description = $request->input('description');
     $things->quantity = $request->input('quantity');
     $things->problemId = $request->input('id');
     $things->save();
     return "done";
 }