REST API Development with PHP

PHP Hub does not yet have a REST API tutorial. The coming-soon rows are placeholders. The two lessons below are related security reading about request data and cookie authentication. They are not an API course.

0 of 2 published modules marked complete on this device.

  1. Coming soon

    1. HTTP, routes, and JSON responses

    Not published. This row is a placeholder, not a tutorial.

  2. Coming soon

    2. Request validation and authentication

    Not published. This row is a placeholder, not a tutorial.

  3. Coming soon

    3. Pagination, errors, and versioning

    Not published. This row is a placeholder, not a tutorial.

  4. 4. SQL Injection in Laravel: Raw Queries, Bindings and Safe ORDER BY

    Bind every value (?, named bindings, or the query builder), never interpolate request data into raw SQL, and allow-list column names and sort directions because PDO cannot bind them.

    Related published lesson, not an API tutorial. It covers bindings when request data reaches SQL.

    4 min read

  5. 5. Laravel CSRF Protection: Tokens, Exceptions and SPA Pitfalls

    Keep Laravel CSRF on for cookie-auth routes, put tokens in forms and AJAX headers, exclude only true third-party webhooks, and initialize Sanctum SPAs with /sanctum/csrf-cookie.

    Related published lesson, not an API tutorial. It distinguishes cookie sessions from Bearer tokens.

    4 min read

Practical next steps

Get new briefs by email

Short alerts when a PHP or WordPress vulnerability needs action.

Double opt-in via Buttondown; unsubscribe any time. See our privacy policy.