How to avoid update/create boilerplate codes in Laravel? I tryed the following code:
public function store(ProductRequest $request)
{
return $this->update(new Product, $request);
}
public function update(Product $product, ProductRequest $request)
{
// code
}
However, it seems the first parameter of update need an already in database user and the above code does not work as expected. (it update the entire users in db!)
What is the correct way to achieve that?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire