Urgent.News

What's breaking now, across thousands of outlets.

Tech

Lessons from Running a 2,300-Page Government Jobs Portal on Laravel

We run HiSarkariResult , a Laravel site that tracks Indian government job notifications, exam results, admit cards, answer keys, syllabus pages and admission notices. Today our XML sitemap lists about 2,300 URLs, split roughly like this: Section URLs in sitemap Results ~1,230 Syllabus ~940 Jobs ~100 Admission ~40 That's not huge by web standards, but a site like this has some specific quirks.…

Running a government jobs portal on the Laravel framework, HiSarkariResult maintains a database of 2,300 URLs. These URLs cover various aspects like job notifications, exam results, syllabuses, and admission notices. Despite its size, the site has some unique challenges, with content rapidly becoming stale. The same exam can progress from being a job posting, then an admit card, then an answer key, and finally a result.

Every page must direct users to official PDFs hosted on government websites. Here are some key learnings from managing this Laravel-based portal:

1. Model content around its lifecycle: Instead of creating separate tables for each section like jobs, results, admit_cards, and syllabi, it's more efficient to create a single posts table with a type column. The type column indicates the stage in the recruitment cycle. The fields shared by most records are title, slug, organisation, summary, important dates, official links, and so on.

All that varies is the stage in the recruitment cycle. A PHP-backed enum is used to manage the allowed types. This data organization allows for easy linking between related content, providing users with more relevant information rather than a generic 'latest posts' widget.

2. Enforce content type through routes: To ensure the correct content type is associated with a URL, the route should be set up to only resolve result posts if the URL prefix is /results/{slug}. If the prefix isn't correct, the job post can be inadvertently reached under /results/... resulting in duplicate or misfiled URLs. By using a helper function, this consistency is maintained across all routes.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Treat Every ID as an Authorization Claim

Authentication answers one important question: who made this request? It does not answer a second question that often hides inside an ordinary-looking query parameter: may this caller name the record…

  • Treat identifiers as authorization claims, not just query inputs.
  • Verify identifier scope against caller's authorized access before querying.
  • Reject cross-scope identifiers outright for clear, observable security.

More from Wednesday 30 September →