Exemplo n.º 1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Dashboardwidget              $dashboardwidget
  * @param  DashboardWidgetUpdateRequest $request
  *
  * @return Reponse
  */
 public function update(Dashboardwidget $dashboardwidget, DashboardWidgetUpdateRequest $request)
 {
     if ($request->has('config')) {
         $dashboardwidget->config = $request->get('config');
         $dashboardwidget->save();
     }
     if ($request->ajax()) {
         $dashboardwidget->update(array_filter($request->only('title', 'size')));
     }
     if (!$request->ajax()) {
         return back();
     }
 }