PHP code example of tenantcloud / laravel-auto-generate-swagger

1. Go to this page and download the library: Download tenantcloud/laravel-auto-generate-swagger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tenantcloud / laravel-auto-generate-swagger example snippets


 
 
 namespace App\Http\Requests;  
 
 use Illuminate\Foundation\Http\FormRequest;
 
 /**
  * @summary Updating of user
  *
  * @description
  *  This request mostly needed to specity flags <strong>free_comparison</strong> and 
  *  <strong>all_cities_available</strong> of user
  *
  * @_204 Successful MF!
  */
 class UpdateUserDataRequest extends FormRequest
 {
     /**
      * Determine if the user is authorized to make this request.
      *
      * @return bool
      */
     public function authorize()
     {
         return true;
     }  
   
     /**
      * Get the validation rules that apply to the request.
      *
      * @return array
      */
     public function rules()
     {
         return [
             'all_cities_available' => 'boolean',
             'free_comparison' => 'boolean'
         ];
     }
 }

 


 
 namespace App\Http\Controllers;  
 
 use App\Http\Requests\UpdateRequest;
 
 class UpdateController
 { 
 
 /**
  * @tag json-api
  * @summary Updating of user
  *
  * @description
  *  This request mostly needed to specity flags <strong>free_comparison</strong> and 
  *  <strong>all_cities_available</strong> of user
  *
  * @_204 Successful MF!
  */
    public function update(int $id, UpdateRequest $request)
    {
        //...
    }
 }