Giter VIP home page Giter VIP logo

rest_api_laravel's Introduction

REST API Laravel Project

Laravel License

This project serves as a learning resource for creating a CRUD API with Laravel. It includes a Laravel project, API endpoints, and a Postman workspace for testing.

Project Overview

This project covers the following topics and features:

  • Creating a Laravel project
  • Implementing CRUD operations for an Instructor model
  • API resource controllers and routes
  • API versioning
  • Database seeding and factories
  • Using Postman for API testing

Getting Started

Setting Up the Environment

To get started with this project, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/your_username/REST_API_Laravel.git
    
    
  2. Navigate to the project directory:

    cd REST_API_Laravel
    
  3. Install Composer dependencies, create a copy of .env, and generate an application key:

    composer install
     cp .env.example .env
    php artisan key:generate
  4. Configure the database by opening .env in a text editor and setting the database connection settings. After making changes, save the file and exit the text editor:

           
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=rest_api  # Set the database name to 'rest_api'
    DB_USERNAME=root      # Your database username
    DB_PASSWORD=          # Your database password
    
    
  5. Create a new database named 'rest_api' in your MySQL database management tool:

  6. Run database migrations and seed the database:

    php artisan migrate
    php artisan db:seed --class=InstructorsTableSeeder
    
  7. Start the Laravel development server:

    php artisan serve
    
    
  8. Import the provided Postman workspace for testing (use the workspace file "Laravel_CRUD_API.postman_workspace" located in the root directory).

  9. Explore and test the API endpoints using Postman:

API Endpoints

Here are the API endpoints provided by this project:

  1. List Instructors (GET): /api/instructors
  2. Create Instructor (POST): /api/instructors
  3. View Instructor (GET): /api/instructors/{id}
  4. Update Instructor (PUT): /api/instructors/{id}
  5. Delete Instructor (DELETE): /api/instructors/{id}

Contributing

Contributions to this project are welcome. Feel free to open issues, submit pull requests, or provide feedback.

License

This project is open-source and available under the MIT License.

rest_api_laravel's People

Contributors

alaeddineth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.