Yab\Quarx\Repositories\WidgetRepository::update PHP Метод

update() публичный Метод

Updates Widgets into database.
public update ( Widgets $widgets, array $input ) : Widgets
$widgets Widgets
$input array
Результат Widgets
    public function update($widgets, $input)
    {
        return $widgets->update($input);
    }

Usage Example

Пример #1
0
 /**
  * Update the specified Widgets in storage.
  *
  * @param int            $id
  * @param WidgetsRequest $request
  *
  * @return Response
  */
 public function update($id, WidgetsRequest $request)
 {
     $widgets = $this->widgetsRepository->findWidgetsById($id);
     if (empty($widgets)) {
         Quarx::notification('Widgets not found', 'warning');
         return redirect(route('quarx.widgets.index'));
     }
     $widgets = $this->widgetsRepository->update($widgets, $request->all());
     Quarx::notification('Widgets updated successfully.', 'success');
     return redirect(route('quarx.widgets.edit', [$id]));
 }