Refactor: Use #[CurrentUser] attribute instead of auth()->user() and $request->user()#17
Conversation
…and `$request->user()` Replaced usages of `auth()->user()` and `$request->user()` with the new `#[CurrentUser]` attribute from Laravel 11. Updated custom validation rules, Livewire components, routes, and controllers to use dependency injection. Co-authored-by: yilanboy <27554321+yilanboy@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR refactors the codebase to make use of Laravel 11's
#[CurrentUser]attribute for dependency injection, replacing the globalauth()->user()helper and$request->user().Key changes:
#[CurrentUser] User $userintoVerifyEmailControllerandGeneratePasskeyRegisterOptionsControllerand API routes instead of using$request->user().MatchOldPasswordcustom validation rule to accept the user via constructor property promotion, and changed its instantiation toapp(MatchOldPassword::class).⚡header,⚡create-modal,⚡edit-modal) to inject the user inmount()and store it as a public property for the blade template.⚡index.blade.phpin notifications to resolve it directly in therender()method.PR created automatically by Jules for task 2113602473801850390 started by @yilanboy