Skip to content

Add job filtering and search functionality with experience level#5

Merged
khaledfahmy123 merged 2 commits into
mainfrom
feat/filters-search
May 30, 2026
Merged

Add job filtering and search functionality with experience level#5
khaledfahmy123 merged 2 commits into
mainfrom
feat/filters-search

Conversation

@mohamedhamdy746

Copy link
Copy Markdown
Contributor

This pull request adds support for job experience level and location reference data, and introduces a new, flexible job search API with advanced filtering and autocomplete functionality. The changes include a new ExperienceLevel enum, updates to the Job model and migrations to support experience levels, a new Location model and seed data, and a new SearchController for robust job and location search endpoints.

Job Experience Level Support:

  • Added a new ExperienceLevel enum and integrated it into the Job model, including attribute casting and making it fillable. A migration was added to include the experience_level column in the job_listings table. [1] [2] [3] [4] [5]
  • Updated job API responses in JobController to include the experience_level field. [1] [2]

Location Reference Data:

  • Added a new Location model, migration, and seeder to provide a reference list of locations for autocomplete and filtering. The seeder includes major cities and remote options. [1] [2] [3] [4]

Advanced Job Search API:

  • Introduced SearchController with a jobs endpoint that supports keyword search, filtering by experience level, location (partial match), work type, category (by slug or ID), date posted, and sorting. Results include detailed job and employer info.
  • Added a locations endpoint to provide a list of locations for autocomplete.

API Routes:

  • Registered new public and candidate-scoped search endpoints in routes/api.php. [1] [2]

Job Listing Query Improvements:

  • Refactored the existing JobController@index to support keyword search, experience level filter, and sorting, aligning it with the new search capabilities. [1] [2]

Copilot AI review requested due to automatic review settings May 30, 2026 04:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds job search/filtering support around experience levels and location reference data, extending candidate job discovery APIs.

Changes:

  • Adds ExperienceLevel enum, experience_level job column, model casting/fillable support, and job response fields.
  • Adds Location model, migration, and seeder for autocomplete/reference data.
  • Introduces search routes and SearchController endpoints for filtered job search and location lookup.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
routes/api.php Registers public location search and candidate job search routes.
database/seeders/LocationSeeder.php Seeds location reference data.
database/seeders/DatabaseSeeder.php Adds location seeding to the main seed flow.
database/migrations/2026_05_30_200002_create_locations_table.php Creates the locations reference table.
database/migrations/2026_05_30_200001_add_experience_level_to_job_listings.php Adds nullable job experience level storage.
app/Models/Location.php Adds the Eloquent model for locations.
app/Models/Job.php Adds experience level to fillable fields and enum casts.
app/Http/Controllers/Search/SearchController.php Adds job search/filtering and location autocomplete responses.
app/Http/Controllers/Api/V1/JobController.php Extends candidate job listing/search responses with filtering, sorting, pagination, and experience level.
app/Enums/ExperienceLevel.php Defines supported job experience level values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +99 to +100
'company_name' => $job->employer?->employerProfile?->company_name ?? 'Unknown',
'logo_url' => $job->employer?->employerProfile?->logo_url,
Comment on lines +68 to +70
if ($dateFrom = $request->input('date_from')) {
$query->whereDate('created_at', '>=', $dateFrom);
}
Comment thread app/Models/Job.php
protected $fillable = [
'employer_id', 'title', 'description', 'requirements',
'salary_range', 'work_type', 'location', 'category_id',
'salary_range', 'work_type', 'location', 'experience_level', 'category_id',
@khaledfahmy123 khaledfahmy123 merged commit eef966c into main May 30, 2026
1 check passed
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.

3 participants