Skip links
🔧
Need help with installation?
Send an email to [email protected] to get a quote.

REST API Setup

Table of Contents

Generating API Documentation, and Accessing the API

  1. Running Migrations
    To set up OAuth2 Passport with Laravel, follow these steps:
    1. Run Migrations
      Execute the following command from the root of your Laravel project to set up the necessary tables for Passport:
      php artisan migrate
    2. Install Passport
      Install Passport and generate the encryption keys:
      php artisan passport:install
      Copy and save the generated client_id and client_secret values. You’ll need these for accessing the API in the next steps.
      That’s it! Your OAuth2 Passport setup is now complete.
  2. Generating API Documentation
    To generate API documentation using L5-Swagger:
    1. Generate Documentation
      Run the following command from the root of your Laravel project to generate Swagger documentation:
      php artisan l5-swagger:generate
    2. Access Documentation
      Your API documentation is now available. Access it by visiting http://your-app-url/api/documentation in your web browser.