public function update(CreatePackageRequest $request, $package)
 {
     if (!$this->package->update($package->id, $request->all())) {
         flash()->error('There was an error when updating a Package. Please double-check your inputs.');
         return redirect()->back()->withInput();
     }
     flash()->success('Package has been successfully updated.');
     return redirect()->route('admin.packages.index');
 }
Exemplo n.º 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(\App\Http\Requests\CreatePackageRequest $request)
 {
     $package = \App\Models\Package::create($request->all());
     $fileName = \Carbon\Carbon::now()->timestamp . "_package.jpg";
     $request->file('photo')->move('img', $fileName);
     $package->picture = $fileName;
     $package->save();
     return redirect('pricingPackages');
 }
Exemplo n.º 3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(CreatePackageRequest $request, $package)
 {
     $this->package->update($package->id, $request->all());
     flash()->success('Eclipse', 'Package has been successfully updated.');
     return redirect()->route('admin.packages.index');
 }