Skip to content

Conversation

@Nima8FT
Copy link

@Nima8FT Nima8FT commented Nov 4, 2025

This PR refactors the routes/web.php file to replace the deprecated Route::namespace() usage with proper 'use' statements at the top of the file.

  • Removed namespace() calls
  • Imported controllers using 'use'
  • Updated route definitions to use [Controller::class, 'method'] syntax

This aligns the project with modern Laravel standards.

Fix #340

@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Walkthrough

The pull request refactors route definitions in routes/web.php from namespace-based controller references to explicit class-based references. This involves adding use statements for approximately 35 controllers and updating route declarations across category, post, personal, and admin route groups to use the ClassName::class syntax instead of string-based namespace strings. The core routing structure, middleware, and grouping logic remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

This refactor applies a consistent and repetitive pattern across a single file. While the volume of changes is substantial (many controller imports and route updates), the homogeneity of the pattern (identical syntax transformation applied throughout) significantly reduces review complexity.

  • Verify all 35+ controller use statements reference valid, existing controller classes
  • Confirm route names (e.g., name('...') declarations) remain consistent and are not inadvertently modified
  • Check that no routes were partially updated or left with mixed syntax (some namespace-based, some class-based)
  • Validate that the controller class references match the actual file structure and namespace organization

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main refactoring change: replacing namespace-based routing with explicit 'use' statements in routes/web.php, which is the core purpose of this changeset.
Description check ✅ Passed The pull request description accurately describes the refactoring work: replacing deprecated Route::namespace() with 'use' statements, updating to class-based controller syntax, and aligning with modern Laravel standards.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Use use instead of namespace in routes/web.php

1 participant