/**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(AssetRequest $request)
 {
     $asset = new Asset($request->all());
     $asset->save()->saveImage();
     flash()->success('Success!', 'Asset has been created!');
     return redirect('assets');
 }
Esempio n. 2
0
 public function store(Request $request)
 {
     $types = array_keys($this->asset_type);
     $sections = array_keys($this->sections);
     $request['type'] = $types[$request['type']];
     $request['section'] = $sections[$request['section']];
     $request['asset_id'] = $this->getAssetId($request);
     $asset = new Asset($request->all());
     $asset->save();
     return redirect('assets');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $asset = new Asset();
     $asset->name = $request->name;
     $asset->type = $request->type;
     $asset->value = $request->value;
     $asset->date = $request->date;
     if (!$asset->save()) {
         return "failed";
     } else {
         return "success";
     }
 }
Esempio n. 4
0
 /**
  * Store a newly created resource in storage.
  *
  * @param Request $request
  * @return Response
  */
 public function store(Request $request)
 {
     $asset = new Asset();
     $asset->capital_id = $request->input("capital_id");
     $asset->name = $request->input("name");
     $asset->price = $request->input("price");
     $asset->value = $request->input("value");
     $asset->growth_rate = $request->input("growth_rate");
     $asset->pattern = $request->input("pattern");
     $asset->cycle_up = $request->input("cycle_up");
     $asset->cycle_down = $request->input("cycle_down");
     $asset->save();
     return redirect()->route('assets.index')->with('message', 'Item created successfully.');
 }