public function delete($id) { $theme = \App\Themes::find($id); $theme->delete(); header('Location:' . url() . '/admin/theme'); exit; }
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update() { \Auth::user()->name = $_POST['name']; \Auth::user()->email = $_POST['email']; $theme = \App\Themes::where('theme_name', '=', $_POST['theme'])->first(); \Auth::user()->theme_id = $theme->id; if (isset($_POST['password'])) { \Auth::user()->password = bcrypt($_POST['password']); } \Auth::user()->save(); header('Location:' . url() . '/settings'); exit; }
/** * Display a listing of the resource. * * @return Response */ public function index() { $themes = \App\Themes::all(); $site_theme = \App\SiteTheme::first(); $user_privileges = new \App\user_privileges(); $user_privileges = $user_privileges->first(); $add_categories = $user_privileges->add_categories; $search_users = $user_privileges->search_users; $post_editor = $user_privileges->full_post_editor; $change_theme = $user_privileges->change_theme; $default_theme = \App\Themes::where('id', '=', $site_theme->default_theme_id)->get()[0]; $data = array('active_nav' => $this->active_nav, 'site_theme' => $site_theme, 'default_theme' => $default_theme, 'themes' => $themes, 'add_categories' => $add_categories, 'search_users' => $search_users, 'post_editor' => $post_editor, 'change_theme' => $change_theme); return view('includes/admin/settings')->with($data); }
<label class="col-md-4 control-label">Confirm New Password</label> <div class="col-md-6"> <input type="password" class="form-control" name="password_confirmation"> </div> </div> <div class="form-group"> <div class="dropdown col-md-8"> <label class="col-md-6 control-label">Theme</label> <select name="theme" class="selectpicker"> <option><?php echo $this_user->Theme()->theme_name; ?> </option> <?php foreach (\App\Themes::all() as $theme) { ?> <?php if ($theme->theme_name != $this_user->Theme()->theme_name) { ?> <option> <?php echo $theme->theme_name; ?> </option> <?php } ?> <?php } ?>