Commit Graph
16 Commits
Author SHA1 Message Date
Parsa Aghayi d659c5d325 Keep generated blog cover URLs within the featured_image VARCHAR(255) limit
Deploy Backend / deploy (push) Successful in 2m48s
Persian covers are percent-encoded into og-image URLs and several long Persian titles produced URLs over 255 chars, failing the prod seeder with a data-too-long error. Shorten Persian cover text so every featured_image fits the column; guard with a seeder test asserting all 24 images are non-empty and under 256 chars.
2026-10-02 08:46:36 -04:00
Parsa Aghayi 65415beae7 Blog localization: lang-filtered API, strict EN/FA mirrored content, 12 new topics
Deploy Backend / deploy (push) Successful in 2m51s
- Add FilterableByLanguage scope (posts/categories/tags) keyed off the -fa slug convention; every public blog list endpoint honors ?lang=fa|en, feeds/sitemaps keep all languages when omitted
- Homepage (latest/most-viewed/random posts + categories) filters per language; post detail shows same-language related posts only
- Reseed content to a strict English/Persian mirror: 6 existing international topics + 6 new Iran-market topics (technical SEO for Persian sites, Iranian dev freelancing, AI & Iranian dev careers, web design for Iranian businesses, React job market in Iran, WordPress-to-Next migration), 12 posts per language, zero posts in only one language
- Fix 2 legacy FA slugs to follow the EN-slug + -fa convention so twin redirects and mirror assertions hold
- Update seeder test to assert balanced languages, full twin coverage and same-language related posts; add lang-filter coverage
2026-10-02 08:27:20 -04:00
Parsa Aghayi d4f41b9c2e Store contact messages in DB and seed real bilingual blog content
Deploy Backend / deploy (push) Successful in 2m40s
Contact form messages were sent via mailto and the site has no mail
service, so visitors saw a placeholder caveat instead of a working
channel. Add a contact_messages table, a public throttled POST endpoint,
and admin list/mark/delete endpoints, then wire them into the panel.

Replace the faker-generated blog demonstration content with real
English and Persian SEO-oriented articles via RealBlogContentSeeder
(deterministic, bilingual posts with per-language categories and tags,
and cross-linked related posts).
2026-10-02 05:41:05 -04:00
root 8b834189a4 Close anonymous write access to the public API and repair the broken test suite
Every mutating endpoint was reachable without authentication, so any visitor
could create, edit or delete posts, categories, tags, projects and about-me
records on the live site.

Security
- Split routes into an anonymous read-only group and a write group gated by
  `auth:sanctum` + a new `admin` middleware.
- Add `is_admin` to users; Sanctum token support on the User model.
- Add AuthController (login / me / logout). The Sanctum token is delivered in
  an httpOnly cookie and never returned in the JSON body, because the admin
  panel reaches the API through a Next.js server-side proxy that breaks
  Sanctum's first-party domain detection.
- AuthenticateAdminPanelSession promotes that cookie to a bearer header so
  Sanctum's normal validation, expiry and revocation still apply.
- Remove the unauthenticated `/user/{id}` route, which exposed user emails.
- Non-admin accounts are refused at login and the failure shape is identical
  to a bad password, so the endpoint cannot enumerate accounts.
- Fix `Route [login] not defined`: a non-JSON unauthenticated request resolved
  a route that does not exist in this API-only app and returned 500.
- Reject invalid list query parameters with 422 instead of 500, and cap
  per_page at 50 (`?per_page=100000` previously dumped whole tables).

Correctness
- Make the translation migration portable. It used MySQL-only JSON_OBJECTAGG,
  which aborted all 29 tests during migration; the data collapse now runs in
  PHP so it works on MySQL, MariaDB and SQLite.
- Add HasJsonTranslations trait providing the missing setTranslation(), which
  made project create/update return 500, and replace five copy-pasted
  getTranslation()/hasTranslation() bodies.
- Make posts.excerpt nullable to match StorePostRequest; omitting an excerpt
  was a guaranteed SQL integrity error.
- Route the AboutMeController CRUD methods that existed but were never
  registered.
- CategoryTest omitted a required description; fixed the test, the existing
  schema and validation already agreed.

Tests: 83 passing / 126 assertions (was 29 failing / 0 assertions)
2026-10-01 14:35:34 -04:00
DevOps 223a4f5640 fix: remove HasTranslations trait, use translations JSON in models + seeders 2026-06-28 17:37:08 +00:00
parsa aghaei ebd4bd19ed content: update about and service seeders with professional senior engineer copy 2026-06-28 20:22:12 +03:30
parsa aghaei e3e5033fec fix: add json translation columns migration, re-add /vendor to .gitignore 2026-06-23 20:00:35 +03:30
parsa aghaei 78a14646eb 6.1-6.2: fix seeders for spatie translatable, uncomment ProjectSeeder, order correctly 2026-06-23 19:23:44 +03:30
parsa aghaei 9ff5b93157 4.1-4.3: add PHPUnit feature tests for all endpoints + factories 2026-06-23 18:37:14 +03:30
parsa aghaei db7ce880a0 2.1-2.4: install spatie/laravel-translatable, migrate to JSON, update models & controllers 2026-06-23 18:31:51 +03:30
parsa aghaei 3450c22b20 service seeder updated 2024-11-11 12:02:13 +03:30
parsa aghaei 67fc35e6f4 service seeder updated 2024-11-11 11:48:04 +03:30
parsa aghaei 6c834607bd multilanguage updated 2024-11-03 16:01:47 +03:30
parsa aghaei 027d1090df internationalization added and backend updated until services 2024-10-23 19:06:12 +03:30
parsa aghaei d98bc7bbb0 blog api created 2024-10-13 20:16:08 +03:30
parsa aghaei bd92c3e3fc initial 2024-09-25 13:05:18 +03:30