Ejemplo n.º 1
0
 /**
  * Show the profile for the given user.
  *
  * @param  int  $id
  * @return Response
  */
 public function listDashboard()
 {
     $page_title = "Dashboard";
     $title = "Admin - Dashboard";
     $m_articles = m_articles::all();
     $count_art = number_format($m_articles->count());
     $m_user = m_user::all();
     $count_user = number_format($m_user->count());
     $m_gallery = m_gallery::all();
     $count_gallery = number_format($m_gallery->count());
     return view('backend.formdashboard', ['title' => $title, 'page_title' => $page_title, 'count_art' => $count_art, 'count_user' => $count_user, 'count_gallery' => $count_gallery]);
 }
Ejemplo n.º 2
0
 public function updateGallery(Request $request)
 {
     $id_gallery = Input::get('txt_idgallery');
     $validator = Validator::make($request->all(), $this->rules);
     $validator->setAttributeNames($this->niceNames);
     if ($validator->fails()) {
         return redirect('gallery/editGallery/' . $id_gallery)->withErrors($validator)->withInput();
     }
     $gallery = m_gallery::find($id_gallery);
     $gallery->name = Input::get('txt_name');
     $gallery->status = Input::get('cb_status');
     $gallery->chby = Session::get('usrid');
     $gallery->slug = str_slug(Input::get('txt_name'), '-');
     if ($gallery->save()) {
         return Redirect::to('gallery/listGallery')->with('success', 'Gallery was updated successfully!');
     }
 }