-
Notifications
You must be signed in to change notification settings - Fork 5
Removed notMerged() call from postsQuery #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe change removes the use of the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Assessment against linked issues
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (4)
app/Http/Controllers/Frontend/BoardController.php (4)
1-2: Missing strict types declaration.The file must start with
declare(strict_types=1);as per the coding guidelines for PHP 8.3+.<?php + +declare(strict_types=1);
18-18: Add explicit return type declaration.The method should have an explicit return type as per PHP 8.3+ guidelines.
- public function show(Request $request, Board $board) + public function show(Request $request, Board $board): \Illuminate\Http\Response|\Inertia\Response
91-91: Add explicit return type declaration.The store method should have an explicit return type declaration.
- public function store(Request $request, Board $board) + public function store(Request $request, Board $board): \Illuminate\Http\RedirectResponse
126-126: Add explicit return type declaration.The private method should have an explicit return type declaration.
- private function notifyAdmins(Post $post) + private function notifyAdmins(Post $post): void
🧹 Nitpick comments (1)
app/Http/Controllers/Frontend/BoardController.php (1)
132-132: Use Model::query() for consistency.For consistency with coding guidelines, use
Model::query()pattern.- $admins = User::admin()->get(); + $admins = User::query()->admin()->get();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/Http/Controllers/Frontend/BoardController.php(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.php
📄 CodeRabbit Inference Engine (.cursor/rules/laravel-conventions.mdc)
**/*.php: PHP 8.3+ required. Use latest language features: typed properties, enums, readonly classes.
Always start files withdeclare(strict_types=1);.
Follow PSR-12 code style.
**/*.php: Always start files withdeclare(strict_types=1);.
PHP 8.3+ features must be leveraged (readonly, typed properties, enums, etc.).
Follow PSR-12 strictly.
Avoid magic methods (__get,__set,__call) unless absolutely necessary.
All methods, functions, and properties must be fully typed.
Usevoidorneverreturn types where appropriate.
Always prefer explicit type declarations over inferred types.
Use dependency injection rather than static access (new Something()inside methods is discouraged).
Use named constructors for complex object creation.
Use docblocks only for revealing array contents (@var list<string>), describing complex structures (generics, traversables), or explaining why something is done.
Use fully qualified class names in docblocks.
Prefer string interpolation with{}braces over concatenation.
Usesprintfwhen formatting multiple variables.
Always throw typed, domain-specific exceptions.
Avoid genericExceptionwherever possible.
Typecast using native casting, not functions (e.g.,$id = (int) $id;).
Preferisset()andarray_key_exists()checks for large arrays.
Always use PHP 8.1+ nativeenumfor fixed value sets.
Use PascalCase for enum cases.
Prioritize regex readability and performance.
Use named capture groups and reuse patterns properly in regular expressions.
Always validate and sanitize external input.
Prevent SQL injection by whitelisting columns.
Escape or purify user-supplied HTML before rendering.
Files:
app/Http/Controllers/Frontend/BoardController.php
{app,config,routes}/**/*.php
📄 CodeRabbit Inference Engine (.cursor/rules/laravel-conventions.mdc)
Environment variables must only be accessed via
config()calls inside application code.
Files:
app/Http/Controllers/Frontend/BoardController.php
{app,routes,database}/**/*.php
📄 CodeRabbit Inference Engine (.cursor/rules/laravel-conventions.mdc)
{app,routes,database}/**/*.php: Always useModel::query()instead of direct static methods.
Eager load relations to avoid N+1 queries.
Avoid magic methods likewhereName(), prefer explicitwhere().
Never allow dynamic column names from user input to prevent SQL Injection.
Cache heavy queries using Laravel Cache.
Usedispatch()helper, not static::dispatch()or Bus Facade.
Use chunking for large datasets (e.g.,chunk(100)).
Use eager loading and indexed columns for performance.
Files:
app/Http/Controllers/Frontend/BoardController.php
🔇 Additional comments (1)
app/Http/Controllers/Frontend/BoardController.php (1)
28-28: Confirm default behavior after removing undefined notMerged()Removing the
notMerged()call successfully fixes the fatal error. Our search shows there is noscopeNotMergedmethod or any other usage ofnotMerged()in the codebase, so merged posts will now be returned by default.
- No definition or usage of
notMergedscope found in thePostmodel or elsewhere- By default, merged posts are now included in the query results
If excluding merged posts remains a requirement, please implement a dedicated scope or filter in a follow-up change.
This PR fixes #29
Summary by CodeRabbit