Ignore:
Timestamp:
10/17/21 18:39:50 (3 years ago)
Author:
Berat Kjufliju <kufliju@…>
Branches:
develop, master
Children:
bd9e8e3
Parents:
120759b
Message:

added validation to blades

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/Http/Controllers/Dashboard/SettingsController.php

    r120759b rd795fa6  
    33namespace App\Http\Controllers\Dashboard;
    44
    5 use App\Helpers\Alert;
    65use App\Http\Requests\Dashboard\EmailSettingsRequest;
    7 use App\Http\Requests\Dashboard\NewUserRequest;
    86use 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;
    137use App\Http\Requests\Dashboard\UsernameSettingsRequest;
    14 use App\Http\Requests\Dashboard\UserProfileSettingsRequest;
    15 use App\Models\Post;
    16 use App\Models\Role;
    178use App\Models\User;
    18 use App\Models\UserProfile;
    19 use Illuminate\Support\Str;
    20 use Illuminate\Http\Request;
    219use App\Http\Controllers\Controller;
    22 use Illuminate\Support\Facades\File;
    23 use Illuminate\Support\Facades\Hash;
    2410use App\Notifications\VerifyNewEmail;
    25 use Illuminate\Support\Facades\Storage;
    26 use Propaganistas\LaravelPhone\PhoneNumber;
    27 use Propaganistas\LaravelIntl\Facades\Country;
     11use Carbon\Carbon;
    2812
    2913class SettingsController extends Controller
     
    3317        return view("dashboard.settings.index")->with([
    3418            "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(),
    3620        ]);
    3721    }
     
    3923    public function updateUsername(UsernameSettingsRequest $request)
    4024    {
    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       // }
    4938    }
    5039
Note: See TracChangeset for help on using the changeset viewer.