Skip to content

Commit

Permalink
feat (PHP LARAVEL) 8417: adjust route service provdider and model gen…
Browse files Browse the repository at this point in the history
…eration
  • Loading branch information
renepardon committed Jul 18, 2018
1 parent 7c0aa8c commit 606cf90
Show file tree
Hide file tree
Showing 41 changed files with 701 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ public PhpLaravelServerCodegen() {
/*
* Model Package. Optional, if needed, this can be used in templates
*/
modelPackage = "models";
modelPackage = "app.Models";

// template files want to be ignored
modelTemplateFiles.clear();
apiTestTemplateFiles.clear();
apiDocTemplateFiles.clear();
modelDocTemplateFiles.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ protected function mapWebRoutes()
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
Route::middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0-SNAPSHOT
3.1.2-SNAPSHOT
2 changes: 1 addition & 1 deletion samples/server/petstore/php-laravel/lib/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:Rftzh5fw/3aLT8zlkCMr2cT7WoRh9taPgDtkEfk+wFo=
APP_KEY=base64:DLKuAaa5bAytB73eQNHV4KBfRzQxh9ix8J3gc0sbfGc=
APP_DEBUG=true
APP_URL=http://localhost

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testClientModel()
/**
* Operation testEndpointParameters
*
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 .
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트.
*
*
* @return Http response
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* AdditionalPropertiesClass
*/
namespace app.Models;

/**
* AdditionalPropertiesClass
*/
class AdditionalPropertiesClass {

/** @var map[string,string] $map_property */
private $map_property;

/** @var map[string,map[string,string]] $map_of_map_property */
private $map_of_map_property;

}
18 changes: 18 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/Animal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Animal
*/
namespace app.Models;

/**
* Animal
*/
class Animal {

/** @var string $class_name */
private $class_name;

/** @var string $color */
private $color;

}
12 changes: 12 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/AnimalFarm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* AnimalFarm
*/
namespace app.Models;

/**
* AnimalFarm
*/
class AnimalFarm {

}
21 changes: 21 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/ApiResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* ApiResponse
*/
namespace app.Models;

/**
* ApiResponse
*/
class ApiResponse {

/** @var int $code */
private $code;

/** @var string $type */
private $type;

/** @var string $message */
private $message;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* ArrayOfArrayOfNumberOnly
*/
namespace app.Models;

/**
* ArrayOfArrayOfNumberOnly
*/
class ArrayOfArrayOfNumberOnly {

/** @var float[][] $array_array_number */
private $array_array_number;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* ArrayOfNumberOnly
*/
namespace app.Models;

/**
* ArrayOfNumberOnly
*/
class ArrayOfNumberOnly {

/** @var float[] $array_number */
private $array_number;

}
21 changes: 21 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/ArrayTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* ArrayTest
*/
namespace app.Models;

/**
* ArrayTest
*/
class ArrayTest {

/** @var string[] $array_of_string */
private $array_of_string;

/** @var int[][] $array_array_of_integer */
private $array_array_of_integer;

/** @var \app.Models\ReadOnlyFirst[][] $array_array_of_model */
private $array_array_of_model;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Capitalization
*/
namespace app.Models;

/**
* Capitalization
*/
class Capitalization {

/** @var string $small_camel */
private $small_camel;

/** @var string $capital_camel */
private $capital_camel;

/** @var string $small_snake */
private $small_snake;

/** @var string $capital_snake */
private $capital_snake;

/** @var string $sca_eth_flow_points */
private $sca_eth_flow_points;

/** @var string $att_name Name of the pet*/
private $att_name;

}
21 changes: 21 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/Cat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Cat
*/
namespace app.Models;

/**
* Cat
*/
class Cat {

/** @var string $class_name */
private $class_name;

/** @var string $color */
private $color;

/** @var bool $declawed */
private $declawed;

}
18 changes: 18 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/Category.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Category
*/
namespace app.Models;

/**
* Category
*/
class Category {

/** @var int $id */
private $id;

/** @var string $name */
private $name;

}
15 changes: 15 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/ClassModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* ClassModel
*/
namespace app.Models;

/**
* ClassModel
*/
class ClassModel {

/** @var string $_class */
private $_class;

}
15 changes: 15 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/Client.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Client
*/
namespace app.Models;

/**
* Client
*/
class Client {

/** @var string $client */
private $client;

}
21 changes: 21 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/Dog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Dog
*/
namespace app.Models;

/**
* Dog
*/
class Dog {

/** @var string $class_name */
private $class_name;

/** @var string $color */
private $color;

/** @var string $breed */
private $breed;

}
18 changes: 18 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/EnumArrays.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* EnumArrays
*/
namespace app.Models;

/**
* EnumArrays
*/
class EnumArrays {

/** @var string $just_symbol */
private $just_symbol;

/** @var string[] $array_enum */
private $array_enum;

}
12 changes: 12 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/EnumClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* EnumClass
*/
namespace app.Models;

/**
* EnumClass
*/
class EnumClass {

}
27 changes: 27 additions & 0 deletions samples/server/petstore/php-laravel/lib/app/Models/EnumTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* EnumTest
*/
namespace app.Models;

/**
* EnumTest
*/
class EnumTest {

/** @var string $enum_string */
private $enum_string;

/** @var string $enum_string_required */
private $enum_string_required;

/** @var int $enum_integer */
private $enum_integer;

/** @var double $enum_number */
private $enum_number;

/** @var \app.Models\OuterEnum $outer_enum */
private $outer_enum;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* FileSchemaTestClass
*/
namespace app.Models;

/**
* FileSchemaTestClass
*/
class FileSchemaTestClass {

/** @var \app.Models\File $file */
private $file;

/** @var \app.Models\File[] $files */
private $files;

}
Loading

0 comments on commit 606cf90

Please sign in to comment.