This repository contains the source code for the database for a collection of TheTinMen posts. It uses Laravel 11.
For some posts, other useful data is also stored.
The database was created with community collaboration in mind. For this reason, a public API is provided with unrestricted read access, with no token or user login required. Write access is limited—see the API section for more information.
- WSL2 (if you're on Windows)
- PHP 8.2
- Composer
- Docker
It is assumed that you have set up the alias for sail
.
-
Clone the repository and navigate to the project directory.
git clone https://github.com/BackThePortal/thetinmen-db.git && cd thetinmen-db
-
Create the
.env
file using.env.example
.cp .env.example .env
-
Install dependencies.
composer install
-
Install Sail and run it.
php artisan sail:install && sail up -d
-
Generate application key.
sail artisan key:generate
-
Reset database and run seeders
sail php artisan migrate:fresh --seed
-
Run remaining migrations
sail php artisan migrate
-
Create model and its migration.
sail php artisan make:model Name -m
-
Create API resource controller from model.
sail php artisan make:controller NameController --api --model=Name
-
Generate API token for user
sail artisan user:create-token [email|id]
-
Generate API documentation
sail php artisan scribe:generate
API documentation is automatically generated using Scribe with the Scalar theme. It is available here.