Skip to content

Explore Laravel 11's RESTful capabilities with this concise API demo. Built with simplicity and efficiency in mind, it's perfect for learning and experimentation.

License

sulitjomar/laravel-11-rest-api-sample

Repository files navigation

Laravel 11 REST API Sample Project

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.

Prerequisites

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

Installation

To install the project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/sulitjomar/laravel-11-rest-api-sample.git
  2. Set up your environment configuration:

    • Copy the .env.example file and rename it to .env or just run the command then configure your database credentials:

      cp .env.example .env
  3. Run the command:

    composer install && composer run dev

Usage

After setting up the project, you can utilize it in the following ways:

  1. API Endpoint Interaction: Utilize the defined API endpoints for various CRUD (Create, Read, Update, Delete) operations on resources.
  2. PHPUnit Testing: Verify the functionality of the API by running PHPUnit tests. Execute php artisan test in your terminal to run the tests.
  3. Swagger Documentation: Explore the API documentation generated by Swagger at http://localhost:8000/api/documentation.

Contributing

To contribute to this project, follow these steps:

  1. Clone the repository.
  2. 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>
  3. Make your changes.
  4. 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>'
  5. Push to the branch: git push origin <branch_name>
  6. Create a new Pull Request.

License

This project is licensed under the terms provided by Jomar Sulit. For details, see the LICENSE.md file.

Contact

If you have any questions or suggestions, feel free to contact Jomar Sulit at sulitjomar@gmail.com.

About

Explore Laravel 11's RESTful capabilities with this concise API demo. Built with simplicity and efficiency in mind, it's perfect for learning and experimentation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published