{"id":15108506,"url":"https://github.com/gothinkster/laravel-realworld-example-app","last_synced_at":"2025-09-27T07:31:07.423Z","repository":{"id":37434287,"uuid":"89945336","full_name":"gothinkster/laravel-realworld-example-app","owner":"gothinkster","description":"Exemplary real world backend API built with Laravel","archived":true,"fork":false,"pushed_at":"2022-04-22T22:02:40.000Z","size":359,"stargazers_count":1194,"open_issues_count":20,"forks_count":1058,"subscribers_count":58,"default_branch":"master","last_synced_at":"2024-09-26T22:02:09.568Z","etag":null,"topics":["backend","codebase","crud","demo-app","jwt","laravel","realworld","rest-api"],"latest_commit_sha":null,"homepage":"https://realworld.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gothinkster.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-01T17:22:38.000Z","updated_at":"2024-09-25T08:20:12.000Z","dependencies_parsed_at":"2022-07-10T15:47:54.304Z","dependency_job_id":null,"html_url":"https://github.com/gothinkster/laravel-realworld-example-app","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gothinkster%2Flaravel-realworld-example-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gothinkster%2Flaravel-realworld-example-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gothinkster%2Flaravel-realworld-example-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gothinkster%2Flaravel-realworld-example-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gothinkster","download_url":"https://codeload.github.com/gothinkster/laravel-realworld-example-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234410013,"owners_count":18828120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","codebase","crud","demo-app","jwt","laravel","realworld","rest-api"],"created_at":"2024-09-25T22:02:15.739Z","updated_at":"2025-09-27T07:31:02.002Z","avatar_url":"https://github.com/gothinkster.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![Laravel Example App](logo.png)\n\n[![Build Status](https://img.shields.io/travis/gothinkster/laravel-realworld-example-app/master.svg)](https://travis-ci.org/gothinkster/laravel-realworld-example-app) [![Gitter](https://img.shields.io/gitter/room/realworld-dev/laravel.svg)](https://gitter.im/realworld-dev/laravel) [![GitHub stars](https://img.shields.io/github/stars/gothinkster/laravel-realworld-example-app.svg)](https://github.com/gothinkster/laravel-realworld-example-app/stargazers) [![GitHub license](https://img.shields.io/github/license/gothinkster/laravel-realworld-example-app.svg)](https://raw.githubusercontent.com/gothinkster/laravel-realworld-example-app/master/LICENSE)\n\n\u003e ### Example Laravel codebase containing real world examples (CRUD, auth, advanced patterns and more) that adheres to the [RealWorld](https://github.com/gothinkster/realworld-example-apps) spec and API.\n\nThis repo is functionality complete — PRs and issues welcome!\n\n----------\n\n# Getting started\n\n## Installation\n\nPlease check the official laravel installation guide for server requirements before you start. [Official Documentation](https://laravel.com/docs/5.4/installation#installation)\n\nAlternative installation is possible without local dependencies relying on [Docker](#docker). \n\nClone the repository\n\n    git clone git@github.com:gothinkster/laravel-realworld-example-app.git\n\nSwitch to the repo folder\n\n    cd laravel-realworld-example-app\n\nInstall all the dependencies using composer\n\n    composer install\n\nCopy the example env file and make the required configuration changes in the .env file\n\n    cp .env.example .env\n\nGenerate a new application key\n\n    php artisan key:generate\n\nGenerate a new JWT authentication secret key\n\n    php artisan jwt:generate\n\nRun the database migrations (**Set the database connection in .env before migrating**)\n\n    php artisan migrate\n\nStart the local development server\n\n    php artisan serve\n\nYou can now access the server at http://localhost:8000\n\n**TL;DR command list**\n\n    git clone git@github.com:gothinkster/laravel-realworld-example-app.git\n    cd laravel-realworld-example-app\n    composer install\n    cp .env.example .env\n    php artisan key:generate\n    php artisan jwt:generate \n    \n**Make sure you set the correct database connection information before running the migrations** [Environment variables](#environment-variables)\n\n    php artisan migrate\n    php artisan serve\n\n## Database seeding\n\n**Populate the database with seed data with relationships which includes users, articles, comments, tags, favorites and follows. This can help you to quickly start testing the api or couple a frontend and start using it with ready content.**\n\nOpen the DummyDataSeeder and set the property values as per your requirement\n\n    database/seeds/DummyDataSeeder.php\n\nRun the database seeder and you're done\n\n    php artisan db:seed\n\n***Note*** : It's recommended to have a clean database before seeding. You can refresh your migrations at any point to clean the database by running the following command\n\n    php artisan migrate:refresh\n    \n## Docker\n\nTo install with [Docker](https://www.docker.com), run following commands:\n\n```\ngit clone git@github.com:gothinkster/laravel-realworld-example-app.git\ncd laravel-realworld-example-app\ncp .env.example.docker .env\ndocker run -v $(pwd):/app composer install\ncd ./docker\ndocker-compose up -d\ndocker-compose exec php php artisan key:generate\ndocker-compose exec php php artisan jwt:generate\ndocker-compose exec php php artisan migrate\ndocker-compose exec php php artisan db:seed\ndocker-compose exec php php artisan serve --host=0.0.0.0\n```\n\nThe api can be accessed at [http://localhost:8000/api](http://localhost:8000/api).\n\n## API Specification\n\nThis application adheres to the api specifications set by the [Thinkster](https://github.com/gothinkster) team. This helps mix and match any backend with any other frontend without conflicts.\n\n\u003e [Full API Spec](https://github.com/gothinkster/realworld/tree/master/api)\n\nMore information regarding the project can be found here https://github.com/gothinkster/realworld\n\n----------\n\n# Code overview\n\n## Dependencies\n\n- [jwt-auth](https://github.com/tymondesigns/jwt-auth) - For authentication using JSON Web Tokens\n- [laravel-cors](https://github.com/barryvdh/laravel-cors) - For handling Cross-Origin Resource Sharing (CORS)\n\n## Folders\n\n- `app` - Contains all the Eloquent models\n- `app/Http/Controllers/Api` - Contains all the api controllers\n- `app/Http/Middleware` - Contains the JWT auth middleware\n- `app/Http/Requests/Api` - Contains all the api form requests\n- `app/RealWorld/Favorite` - Contains the files implementing the favorite feature\n- `app/RealWorld/Filters` - Contains the query filters used for filtering api requests\n- `app/RealWorld/Follow` - Contains the files implementing the follow feature\n- `app/RealWorld/Paginate` - Contains the pagination class used to paginate the result\n- `app/RealWorld/Slug` - Contains the files implementing slugs to articles\n- `app/RealWorld/Transformers` - Contains all the data transformers\n- `config` - Contains all the application configuration files\n- `database/factories` - Contains the model factory for all the models\n- `database/migrations` - Contains all the database migrations\n- `database/seeds` - Contains the database seeder\n- `routes` - Contains all the api routes defined in api.php file\n- `tests` - Contains all the application tests\n- `tests/Feature/Api` - Contains all the api tests\n\n## Environment variables\n\n- `.env` - Environment variables can be set in this file\n\n***Note*** : You can quickly set the database information and other variables in this file and have the application fully working.\n\n----------\n\n# Testing API\n\nRun the laravel development server\n\n    php artisan serve\n\nThe api can now be accessed at\n\n    http://localhost:8000/api\n\nRequest headers\n\n| **Required** \t| **Key**              \t| **Value**            \t|\n|----------\t|------------------\t|------------------\t|\n| Yes      \t| Content-Type     \t| application/json \t|\n| Yes      \t| X-Requested-With \t| XMLHttpRequest   \t|\n| Optional \t| Authorization    \t| Token {JWT}      \t|\n\nRefer the [api specification](#api-specification) for more info.\n\n----------\n \n# Authentication\n \nThis applications uses JSON Web Token (JWT) to handle authentication. The token is passed with each request using the `Authorization` header with `Token` scheme. The JWT authentication middleware handles the validation and authentication of the token. Please check the following sources to learn more about JWT.\n \n- https://jwt.io/introduction/\n- https://self-issued.info/docs/draft-ietf-oauth-json-web-token.html\n\n----------\n\n# Cross-Origin Resource Sharing (CORS)\n \nThis applications has CORS enabled by default on all API endpoints. The default configuration allows requests from `http://localhost:3000` and `http://localhost:4200` to help speed up your frontend testing. The CORS allowed origins can be changed by setting them in the config file. Please check the following sources to learn more about CORS.\n \n- https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS\n- https://en.wikipedia.org/wiki/Cross-origin_resource_sharing\n- https://www.w3.org/TR/cors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgothinkster%2Flaravel-realworld-example-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgothinkster%2Flaravel-realworld-example-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgothinkster%2Flaravel-realworld-example-app/lists"}