Skip to content

Replaced deprecated Symfony Request::get() usage#18363

Merged
snipe merged 1 commit intogrokability:developfrom
ubc-cpsc:task/request-get
Dec 21, 2025
Merged

Replaced deprecated Symfony Request::get() usage#18363
snipe merged 1 commit intogrokability:developfrom
ubc-cpsc:task/request-get

Conversation

@joelpittet
Copy link
Copy Markdown
Contributor

Why

After upgrading dependencies, deprecations.log is flooded with:

Since symfony/http-foundation 7.4: Request::get() is deprecated, use properties ->attributes, query or request directly instead. in .../vendor/symfony/deprecation-contracts/function.php on line 25
https://symfony.com/blog/new-in-symfony-7-4-request-class-improvements

Laravel still exposes get() through inheritance, but it now triggers Symfony’s deprecation path.
This PR switches to Laravel’s recommended request accessors. As per this discussion laravel/framework#57993

What changed

  • Replaced Blade Request::get('key') usage with request()->input('key') (and introduced small local variables in views to avoid repeated calls).
  • Replaced PHP ->get('key') calls on request objects with ->input('key'):
    • $request->get(...)$request->input(...)
    • request()->get(...)request()->input(...)
    • FormRequest $this->get(...) / $this->request->get(...)$this->input(...)
  • Kept non-request ->get() calls intact (e.g., sessions/headers/response headers).

Files touched (high level)

  • Blade: resources/views/hardware/index.blade.php, resources/views/models/index.blade.php, resources/views/reports/asset.blade.php
  • PHP (controllers/requests/services): multiple in app/Http/... plus app/Services/PredefinedKitCheckoutService.php

Expected impact

  • Eliminates Symfony 7.4 Request::get() deprecation spam
  • No functional behaviour change intended (same input sources; Laravel’s input() is the
    preferred accessor)

@snipe
Copy link
Copy Markdown
Member

snipe commented Dec 21, 2025

You're the best. I've been slowly doing this over time, but sometimes it's better to rip the bandaid off. <3

@snipe snipe merged commit d85b25d into grokability:develop Dec 21, 2025
8 checks passed
@joelpittet
Copy link
Copy Markdown
Contributor Author

🩹 Glad to help, these changes can be tedious and disruptive. Nice work on ripping off the band-aid! I am sure they are well-meaning from Symfony's perspective; it probably shouldn't have been doing more than the query string get parameters in the first place, but well...

@snipe snipe changed the title fix: replace deprecated Symfony Request::get() usage Replaced deprecated Symfony Request::get() usage Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants