Skip to content

Laravel implementation of GoThinkster's RealWorld API ("Mother of all demo apps")

Notifications You must be signed in to change notification settings

yoerriwalstra/real-world

Repository files navigation

Laravel RealWorld Example App

RealWorld: Backend Tests: status Static Analysis: status

Example of a PHP-based Laravel application containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld API spec.

This codebase was created to demonstrate a backend application built with Laravel framework including RESTful services, CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Laravel framework community style guides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

The API is built with Laravel, making the most of the framework's features out-of-the-box.

Getting started

The preferred way of setting up the project is using Laravel Sail, for that you'll need Docker under Linux / macOS (or Windows WSL2).

Installation

Clone the repository and change directory:

git clone https://github.com/yoerriwalstra/real-world.git
cd real-world

Install dependencies (if you have composer locally):

composer create-project

Alternatively you can do the same with Docker:

docker run --rm -it \
    --volume $PWD:/app \
    --user $(id -u):$(id -g) \
    composer create-project

Start the containers with PHP application and MySQL database:

./vendor/bin/sail up -d

(Optional) Configure a Bash alias for sail command:

alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'

Migrate the database with seeding:

sail artisan migrate --seed

Usage

The API is available at http://localhost:80/api (You can change the APP_PORT in .env file).

Run tests

sail artisan test

Contributions

Feedback, suggestions, and improvements are welcome, feel free to contribute.

About

Laravel implementation of GoThinkster's RealWorld API ("Mother of all demo apps")

Resources

Stars

Watchers

Forks

Languages