public function Create(Request $request)
 {
     echo $request->Name;
     $Product = new Travel();
     $Product->Title = $request->Title;
     $Product->Content = $request->Content;
     $Product->CreatedBy = "Admin";
     $Product->save();
 }
 public function store(Request $request)
 {
     $credentials = $request->all();
     $credentials['user_id'] = Auth::user()->id;
     $credentials['radio'] = (int) $request->input('radio');
     $credentials['airconditioner'] = (int) $request->input('airconditioner');
     $credentials['bags'] = (int) $request->input('bags');
     Travel::create($credentials);
     return redirect()->back();
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Travel::destroy($id);
 }
Example #4
0
 public function changeStatus($status, $id)
 {
     if (Auth::user()->hasRole('accountant')) {
         $travel = Travel::findOrFail($id);
         $travel->status = $status;
         $travel->accountant_id = Auth::user()->id;
         $travel->save();
         Notification::success('Viaje #' . $id . ' estado actualizado correctamente');
         return redirect('travels');
     }
     return redirect('travels');
 }