Skip to main content
RESTful API for Modern Blogs

Laravel Blog API Documentation

A complete RESTful API built with Laravel for managing blog posts, categories, and users. Features JWT authentication, image uploads, and comprehensive CRUD operations.

Quick Start

Get up and running with the Laravel Blog API in minutes

1

Clone and install dependencies

Clone the repository and install PHP dependencies with Composer:
git clone https://github.com/lhmarroquin/api-rest-laravel.git
cd api-rest-laravel
composer install
2

Configure environment

Copy the environment file and generate an application key:
cp .env.example .env
php artisan key:generate
Update your .env file with database credentials and other configuration.
3

Run migrations

Set up your database schema:
php artisan migrate
4

Make your first API call

Register a new user account:
cURL
curl -X POST http://localhost:8000/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "json": "{\"name\":\"John\",\"surname\":\"Doe\",\"email\":\"[email protected]\",\"password\":\"secret123\"}"
  }'
{
  "status": "success",
  "code": "200",
  "message": "El usuario se ha creado correctamente",
  "user": {
    "name": "John",
    "surname": "Doe",
    "email": "[email protected]",
    "role": "ROLE_USER",
    "updated_at": "2024-03-04T12:00:00.000000Z",
    "created_at": "2024-03-04T12:00:00.000000Z",
    "id": 1
  }
}

Explore the API

Comprehensive endpoints for building modern blog applications

Authentication

Register users and authenticate with JWT tokens

User Management

Manage user profiles and avatar uploads

Blog Posts

Complete CRUD operations for blog posts with images

Categories

Organize content with post categories

Key Features

Everything you need to build a production-ready blog platform

JWT Authentication

Secure token-based authentication with automatic expiration and validation

Image Uploads

Upload and manage images for posts and user avatars with validation

CRUD Operations

Complete create, read, update, and delete functionality for all resources

Category System

Organize posts with categories and query posts by category

User Profiles

Manage user information with profile updates and role-based access

RESTful Design

Clean API design following REST principles with JSON responses

Ready to get started?

Follow our quickstart guide to set up the API and make your first authenticated request in minutes.

View Quickstart Guide

Build docs developers (and LLMs) love