Back to buildsBUILD RECORD

ListingApp / Directory-platform learning project / 2024

Combining directory search with moderated ratings.

ListingApp adds category, location and amenity conditions to one Laravel query, then returns matching listings with ratings from approved reviews.

THE WORK

The project.

ListingApp's search brings directory criteria and review data into the same result. The Laravel coursework filters active, approved listings by text and related category, location and amenity records, then calculates approved review counts and average ratings before pagination. A listing's approval doesn't automatically approve its feedback: each review must pass its own condition to contribute to the displayed rating.

IMPLEMENTATION

Design choices.

  1. Optional conditions build on one listing query, allowing text and relationship filters to be combined without separate search handlers for each combination.
  2. Review approval is checked inside the aggregates. Listing moderation and review moderation therefore remain separate decisions even when their results appear on the same card.
  3. The opening label comes from the day's stored start and end times rather than a separately edited status. That ties the label to the schedule the application already holds.

HOW IT FITS TOGETHER

Architecture.

  • The search controller starts with active, approved listings and adds the requested filters through Eloquent relationships. It then paginates the query and passes the results and filter choices to Blade.
  • Review counts and average ratings each restrict their aggregate to approved reviews. The result page receives those values with the listing rather than treating every submitted review as published feedback.
  • The detail page loads the listing and its reviews separately, and derives its open or closed label from the day's schedule. Its listing lookup requires active status but doesn't repeat the search query's approval check.

MADE WITH

PHP · Laravel 10 · Blade · Eloquent · DataTables · Spatie permissions

ACCESS & INPUT

Security controls.

  • Search requires active, approved listings. The detail lookup only applies active status, so exclusion from search doesn't establish that a listing can't be opened directly.

CHECKS & RESULTS

What was checked.

A source review shows what the code does. It is not a fresh test of the running app.

  1. Code and development records reviewedReviewed

    The code, tests and available development records were checked. Reported test results keep their original scope. No fresh app or live deployment check was run for this write-up.

    Scope of this check
    Code review, not a fresh run of the app

NEXT

Still to work through.

Search and detail need a consistent publication rule before reuse. The wider payment and messaging paths also need their own review; this account is based on the directory source, not a fresh application or security test.