Ignore:
Timestamp:
10/18/21 19:54:18 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
b9c4a92
Parents:
bd9e8e3
Message:

added pagination, is_important

File:
1 edited

Legend:

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

    rbd9e8e3 re6c1f87  
    33namespace App\Http\Controllers\Dashboard;
    44
     5use App\Helpers\Alert;
    56use App\Http\Requests\Dashboard\EmailSettingsRequest;
    67use App\Http\Requests\Dashboard\PasswordSettingsRequest;
     
    1011use App\Notifications\VerifyNewEmail;
    1112use Carbon\Carbon;
     13use Illuminate\Contracts\Validation\Validator;
     14use Illuminate\Http\Request;
     15use Illuminate\Validation\ValidationException;
    1216
    1317class SettingsController extends Controller
     
    1721        return view("dashboard.settings.index")->with([
    1822            "user" => auth()->user(),
    19             "adminAndEditors" => User::where("role_id", 1)->orWhere("role_id", 2)->get(),
     23            "adminAndReferents" => User::where("role_id", 1)->orWhere("role_id", 2)->get(),
    2024            "active_tab" => "account"
    2125        ]);
     
    2428    public function updateUsername(UsernameSettingsRequest $request)
    2529    {
    26         if ($request->validated()) {
    2730            $user = auth()->user();
    2831            $user->username = $request->username;
     
    3336
    3437            return redirect()->route("auth.loginShow");
    35         } else {
    36             return back()->with(['active_tab' => 'security']);
    37         }
    38 
    39         dd('no');
    4038    }
    4139
    42     public function updatePassword(PasswordSettingsRequest $request)
     40    public function updatePassword(UsernameSettingsRequest $request)
    4341    {
    44         $user = auth()->user();
    45         $user->password = bcrypt($request->password);
    46         $user->save();
     42            $user = auth()->user();
     43            $user->password = bcrypt($request->password);
     44            $user->save();
    4745
    48         auth()->logout();
    49         session()->flush();
     46            auth()->logout();
     47            session()->flush();
    5048
    51         return redirect()->route("auth.loginShow");
     49            return redirect()->route("auth.loginShow");
    5250    }
    5351
Note: See TracChangeset for help on using the changeset viewer.