This project serves as a sample implementation of a RESTful API using Laravel 11. It showcases the usage of the repository pattern, PHPUnit testing, and Swagger for API documentation.
Before you begin, ensure you have met the following requirements:
- PHP: At least version 8.2.4
- COMPOSER: At least version 2.5.5
- MariaDB: At least 10.4.22
- Node.JS: At least version 20.11.0
- XAMPP: Latest version
- GIT BASH: At least version 2.41.0.windows.3
- NPM: At least version 10.5.0
To install the project, follow these steps:
-
Clone the repository:
git clone https://github.com/sulitjomar/laravel-11-rest-api-sample.git
-
Set up your environment configuration:
-
Copy the
.env.examplefile and rename it to.envor just run the command then configure your database credentials:cp .env.example .env
-
-
Run the command:
composer install && composer run dev
After setting up the project, you can utilize it in the following ways:
- API Endpoint Interaction: Utilize the defined API endpoints for various CRUD (Create, Read, Update, Delete) operations on resources.
- PHPUnit Testing: Verify the functionality of the API by running PHPUnit tests. Execute
php artisan testin your terminal to run the tests. - Swagger Documentation: Explore the API documentation generated by Swagger at http://localhost:8000/api/documentation.
To contribute to this project, follow these steps:
- Clone the repository.
- Create a new branch:
- For a new feature or enhancement:
git checkout -b feat/<feature_name> - For an issue or bug resolution:
git checkout -b fix/<fix_name> - For maintenance or non-functional tasks or config tasks:
git checkout -b chore/<chore_name>
- For a new feature or enhancement:
- Make your changes.
- Commit your changes:
- For a new feature or enhancement:
git commit -m 'feat: <commit_message>' - For an issue or bug resolution:
git commit -m 'fix: <commit_message>' - For maintenance or non-functional or config tasks:
git commit -m 'chore: <commit_message>'
- For a new feature or enhancement:
- Push to the branch:
git push origin <branch_name> - Create a new Pull Request.
This project is licensed under the terms provided by Jomar Sulit. For details, see the LICENSE.md file.
If you have any questions or suggestions, feel free to contact Jomar Sulit at sulitjomar@gmail.com.