Changeset d795fa6 for app/Http/Controllers/Dashboard/SettingsController.php
- Timestamp:
- 10/17/21 18:39:50 (3 years ago)
- Branches:
- develop, master
- Children:
- bd9e8e3
- Parents:
- 120759b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/Dashboard/SettingsController.php
r120759b rd795fa6 3 3 namespace App\Http\Controllers\Dashboard; 4 4 5 use App\Helpers\Alert;6 5 use App\Http\Requests\Dashboard\EmailSettingsRequest; 7 use App\Http\Requests\Dashboard\NewUserRequest;8 6 use App\Http\Requests\Dashboard\PasswordSettingsRequest; 9 use App\Http\Requests\Dashboard\PhotosSettingsRequest;10 use App\Http\Requests\Dashboard\SocialLinksSettingsRequest;11 use App\Http\Requests\Dashboard\UpdateUserData;12 use App\Http\Requests\Dashboard\UpdateUserRequest;13 7 use App\Http\Requests\Dashboard\UsernameSettingsRequest; 14 use App\Http\Requests\Dashboard\UserProfileSettingsRequest;15 use App\Models\Post;16 use App\Models\Role;17 8 use App\Models\User; 18 use App\Models\UserProfile;19 use Illuminate\Support\Str;20 use Illuminate\Http\Request;21 9 use App\Http\Controllers\Controller; 22 use Illuminate\Support\Facades\File;23 use Illuminate\Support\Facades\Hash;24 10 use App\Notifications\VerifyNewEmail; 25 use Illuminate\Support\Facades\Storage; 26 use Propaganistas\LaravelPhone\PhoneNumber; 27 use Propaganistas\LaravelIntl\Facades\Country; 11 use Carbon\Carbon; 28 12 29 13 class SettingsController extends Controller … … 33 17 return view("dashboard.settings.index")->with([ 34 18 "user" => auth()->user(), 35 "adminAndEditors" => User::where("role_id", 1)->orWhere("role_id", 2)->get() 19 "adminAndEditors" => User::where("role_id", 1)->orWhere("role_id", 2)->get(), 36 20 ]); 37 21 } … … 39 23 public function updateUsername(UsernameSettingsRequest $request) 40 24 { 41 $user = auth()->user(); 42 $user->username = $request->username; 43 $user->save(); 44 45 auth()->logout(); 46 session()->flush(); 47 48 return redirect()->route("auth.loginShow"); 25 // if($request->validated()){ 26 // $user = auth()->user(); 27 // $user->username = $request->username; 28 // $user->save(); 29 // 30 // auth()->logout(); 31 // session()->flush(); 32 // 33 // return redirect()->route("auth.loginShow"); 34 // } 35 // else { 36 return back()->withInput(['tab'=>'security']); 37 // } 49 38 } 50 39
Note:
See TracChangeset
for help on using the changeset viewer.