Skip to content

YJ0411/REST-API-Laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

YJ0411-REST-API-Laravel

A simple REST API built with Laravel.
This project is for learning and experimenting with Laravel RESTful APIs, including CRUD operations.


πŸš€ Features

  • Laravel 10+ REST API
  • CRUD example (Posts API)
  • MySQL database integration
  • Organized structure with Models, Controllers, and Routes

πŸ› οΈ Requirements

  • PHP 8.1 or higher
  • Composer
  • MySQL (or MariaDB)
  • Laravel CLI

⚑ Installation

  1. Clone the repository:

    git clone https://github.com/YOUR-USERNAME/YJ0411-REST-API-Laravel.git
    cd YJ0411-REST-API-Laravel/src
  2. Install dependencies:

 composer install
  1. Copy .env file and configure database:
 cp .env.example .env

Update database credentials inside .env.

  1. Generate application key:
 php artisan key:generate
  1. Run database migrations:
 php artisan migrate
  1. Start local server:
 php artisan serve

App will be running on πŸ‘‰ http://127.0.0.1:8000


πŸ“Œ API Endpoints

Method Endpoint Description
GET /api/health Health Check

πŸ§ͺ Testing with cURL

 curl -X GET http://127.0.0.1:8000/api/health \
     -H "Accept: application/json" \
     -H "Content-Type: application/json"

About

A simple REST API built with Laravel for learning and experimentation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages