This is a very simple chat application API that will allow a user to:
- Send a simple text message to another user.
- Get the messages sent to them and see the author of those messages.
- Mark messages as having been read.
- PHP >= 7.2.5
- PHP SQLite3
-
Clone the chat API repo
-
Update the DB_DATABASE value in the .env file to reflect the absolute path to the database file in your environment.
-
Run the following command from the chat-api folder:
php -S localhost:8000 -t public
You should now be able to run the API requests against your local environment.
All requests require an api_token request header attribute to be passed along with the request.
This token can be found in the users table, and would typically be passed to the front-end during authentication.
Requests are throttled per domain and IP address.
This limit can be configured in routes/web.php and applies to the entire routing group.
Migrations and seeding factories have been provided for use with artisan.
To create a clean database, run:
php artisan migrate:refresh
To re-seed the database, run:
php artisan db:seed