Git Product home page Git Product logo

laravel-g4t-swagger-auto-generate's Introduction

Swagger Laravel Autogenerate Package

The Swagger Laravel Autogenerate Package is a convenient tool that automatically generates Swagger documentation for your Laravel APIs based on your route definitions. It eliminates the need for manually documenting your API endpoints, saving you time and effort.

Swagger Laravel Autogenerate Package

Total Downloads Monthly Downloads Daily Downloads License Latest Stable Version

Features

  • Automatically generates Swagger documentation for Laravel APIs.
  • Extracts route information, including URI, HTTP methods, route names, middleware, and more.
  • Supports request validations and parameter definitions.
  • Generates JSON output conforming to the Swagger/OpenAPI specification.
  • Easy integration and configuration within Laravel projects.

Installation

Install the Swagger Laravel Autogenerate Package via Composer:

composer require g4t/swagger

Usage

Click here to watch a video on how to use this package

Explanatory video on how to use

  1. After installing the package, publish the configuration file:
php artisan vendor:publish --provider "G4T\Swagger\SwaggerServiceProvider"
  1. Configure the package by modifying the config/swagger.php file according to your needs. This file allows you to specify various settings for the Swagger documentation generation.

  2. Access the generated Swagger documentation by visiting the /swagger/documentation route in your Laravel application. For example, http://your-app-url/swagger/documentation.

  3. The issues history page is now included in config/swagger.php, and the default route is http://your-app-url/swagger/issues.

  4. To add a description in a Swagger route using the ->description() method, you can follow the example you provided and include it in your Laravel application's routes. Here's how you can describe a route using the ->description() method in a Swagger route:

     Route::get('user', [UserController::class, 'index'])->description('Get list of users with pagination.');
  5. To add a summary in a Swagger route using the ->summary() method, you can follow the example you provided and include it in your Laravel application's routes. Here's how you can describe a route using the ->summary() method in a Swagger route:

     Route::get('user', [UserController::class, 'index'])->summary('get users.');
  6. To add a Section Description you can use this attribute #[SwaggerSection('everything about your users')] in your controller. Here's how you can use this attribute in your controller:

     <?php
     
     namespace App\Http\Controllers;
     
     use G4T\Swagger\Attributes\SwaggerSection;
     
     #[SwaggerSection('everything about your users')]
     class UserController extends Controller
     {
        // ...
        // ...
        // ...
     }

Contributing

Contributions to the Swagger Laravel Autogenerate Package are always welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

License

The Swagger Laravel Autogenerate Package is open-source software licensed under the MIT license.

Credits

The Swagger Laravel Autogenerate Package is developed and maintained by HusseinAlaa.

Additional Resources

stand with palestine

laravel-g4t-swagger-auto-generate's People

Contributors

hussein4alaa avatar hayder1994zh 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.