/**
  * Remove the specified resource from storage.
  * DELETE /adminscompanyproduct/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($provider_id, $product_id)
 {
     $provider = Provider::find($provider_id);
     $provider->products()->detach($product_id);
     return Redirect::to('admins/companies/' . $provider_id . '/products/');
 }
Exemplo n.º 2
0
 public function dashboard($providers)
 {
     $provider = Provider::find($providers);
     $products = $provider->products;
     return View::make('providers.dashboard', compact('products'));
 }
Exemplo n.º 3
0
 /**
  * Update the specified resource in storage.
  * PUT /adminsprovider/{id}
  *
  * @param  int $id
  * @return Response
  */
 public function update($id)
 {
     $provider = Provider::find($id);
     $input = Input::all();
     $provider->update($input);
     $provider->save();
     return Redirect::to('admins/providers');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $provider = Provider::find($id);
     $provider->delete();
     return Redirect::to('admin/provider')->with('success_message', 'El registro ha sido borrado correctamente.')->withInput();
 }