示例#1
0
 /**
  * Store a new inventory.
  *
  * @return \Illuminate\Http\JsonResponse|mixed
  */
 public function store(Request $request)
 {
     $inventory = $this->inventory->create($request);
     if ($inventory) {
         $message = 'Successfully created inventory item.';
         return redirect()->route('maintenance.inventory.index')->withSuccess($message);
     } else {
         $message = 'There was an issue creating this inventory item. Please try again.';
         return redirect()->route('maintenance.inventory.index')->withErrors($message);
     }
 }