diff --git a/config/default.php b/config/default.php index 659e5e3..aad76b2 100644 --- a/config/default.php +++ b/config/default.php @@ -161,7 +161,7 @@ |-------------------------------------------------------------------------- | */ - 'api_docs_controller_path' => 'Http/Controllers/ApiDocs', + 'api_docs_controller_path' => 'Http/Controllers', /* |-------------------------------------------------------------------------- @@ -338,10 +338,13 @@ ], ], [ - 'match' => ['picture', 'file', 'photo', 'avatar'], + 'match' => ['picture', 'file', 'photo', 'avatar', 'image', 'document', 'attachment*'], 'set' => [ 'is-on-index' => false, 'html-type' => 'file', + 'data-type' => 'string', + 'data-type-params' => [2500], + 'validation' => 'file', ], ], [ @@ -373,7 +376,7 @@ ], ], [ - 'match' => ['created_at', 'updated_at', 'deleted_at'], + 'match' => ['created_at', 'updated_at', 'deleted_at', 'modified_at'], 'set' => [ 'data-type' => 'datetime', 'is-on-form' => false, diff --git a/src/Commands/Api/CreateApiControllerCommand.php b/src/Commands/Api/CreateApiControllerCommand.php index f2ae243..f2f1a74 100644 --- a/src/Commands/Api/CreateApiControllerCommand.php +++ b/src/Commands/Api/CreateApiControllerCommand.php @@ -28,7 +28,7 @@ class CreateApiControllerCommand extends ControllerCommandBase */ protected $signature = 'create:api-controller {model-name : The model name that this controller will represent.} - {--controller-name= : The name of the controler.} + {--controller-name= : The name of the controller.} {--controller-directory= : The directory where the controller should be created under.} {--model-directory= : The path where the model should be created under.} {--resource-file= : The name of the resource-file to import from.} @@ -37,7 +37,7 @@ class CreateApiControllerCommand extends ControllerCommandBase {--language-filename= : The languages file name to put the labels in.} {--with-form-request : This will extract the validation into a request form class.} {--without-form-request : Generate the controller without the form-request file. } - {--with-auth : Generate the controller with Laravel auth middlewear. } + {--with-auth : Generate the controller with Laravel auth middleware. } {--template-name= : The template name to use when generating the code.} {--form-request-directory= : The directory of the form-request.} {--controller-extends=default-controller : The base controller to be extend.} @@ -46,7 +46,7 @@ class CreateApiControllerCommand extends ControllerCommandBase {--api-resource-collection-directory= : The directory where the api-resource-collection should be created.} {--api-resource-name= : The api-resource file name.} {--api-resource-collection-name= : The api-resource-collection file name.} - {--api-version= : The api version to prefix your resurces with.} + {--api-version= : The api version to prefix your resources with.} {--force : This option will override the controller if one already exists.}'; /** @@ -74,7 +74,7 @@ public function handle() if ($input->withApiResource) { if (!Helpers::isApiResourceSupported()) { - $this->info('Api-resource is not supported in the current Laravel version. To use Api-resource, pleae upgrade to Laravel 5.5+.'); + $this->info('Api-resource is not supported in the current Laravel version. To use Api-resource, please upgrade to Laravel 5.5+.'); $this->warn('*** Continuing without create api-resource! ***'); } else { $this->makeApiResource($input, false) @@ -162,7 +162,7 @@ protected function getAdditionalNamespaces($input) protected function getNamespacesForUsedRelations(array $fields) { // Since there is no create/edit forms in the API controller, - // No need for any relation's namespances. + // No need for any relation's namespaces. return []; } @@ -498,6 +498,9 @@ protected function getCommandInput() { $input = parent::getCommandInput(); + $cName = trim($this->option('controller-name')); + $input->controllerName = $cName ? Str::finish($cName, Config::getControllerNamePostFix()) : Helpers::makeControllerName($modelName . 'Api'); + $input->apiResourceDirectory = trim($this->option('api-resource-directory')); $input->apiResourceCollectionDirectory = trim($this->option('api-resource-collection-directory')); $input->apiResourceName = trim($this->option('api-resource-name')); diff --git a/src/Commands/Api/CreateApiScaffoldCommand.php b/src/Commands/Api/CreateApiScaffoldCommand.php index 4fcd620..b2a49c8 100644 --- a/src/Commands/Api/CreateApiScaffoldCommand.php +++ b/src/Commands/Api/CreateApiScaffoldCommand.php @@ -193,7 +193,7 @@ protected function createRoutes(ApiScaffoldInput $input, Field $primaryField = n } /** - * Get the Api folder after removing the controllers path. + * Get the API folder after removing the controllers path. * * @param string $path * @@ -222,6 +222,9 @@ protected function getCommandInput() { $input = new ApiScaffoldInput(parent::getCommandInput()); + $cName = trim($this->option('controller-name')); + + $input->controllerName = $cName ? Str::finish($cName, Config::getControllerNamePostFix()) : Helpers::makeControllerName($input->modelName . 'Api'); $input->withApiResource = $this->option('with-api-resource'); $input->apiResourceDirectory = $this->option('api-resource-directory'); $input->apiResourceCollectionDirectory = $this->option('api-resource-collection-directory'); diff --git a/src/Commands/ApiDocs/CreateApiDocsControllerCommand.php b/src/Commands/ApiDocs/CreateApiDocsControllerCommand.php index 843ef56..5fcbd89 100644 --- a/src/Commands/ApiDocs/CreateApiDocsControllerCommand.php +++ b/src/Commands/ApiDocs/CreateApiDocsControllerCommand.php @@ -199,7 +199,7 @@ protected function getControllerDirectory($controllerDirectory) } /** - * Gets the destenation file to be created. + * Gets the destination file to be created. * * @param string $name * @param string $path @@ -262,7 +262,7 @@ protected function getCommandInput() { $modelName = trim($this->argument('model-name')); $cName = trim($this->option('controller-name')); - $controllerName = $cName ? Str::finish($cName, Config::getControllerNamePostFix()) : Helpers::makeControllerName($modelName); + $controllerName = $cName ? Str::finish($cName, Config::getControllerNamePostFix()) : Helpers::makeControllerName($modelName . 'ApiDocs'); $prefix = ($this->option('routes-prefix') == 'default-form') ? Helpers::makeRouteGroup($modelName) : $this->option('routes-prefix'); $resourceFile = trim($this->option('resource-file')) ?: Helpers::makeJsonFileName($modelName); $force = $this->option('force'); diff --git a/src/Commands/ApiDocs/CreateApiDocsScaffoldCommand.php b/src/Commands/ApiDocs/CreateApiDocsScaffoldCommand.php index bc13713..8c4454e 100644 --- a/src/Commands/ApiDocs/CreateApiDocsScaffoldCommand.php +++ b/src/Commands/ApiDocs/CreateApiDocsScaffoldCommand.php @@ -7,10 +7,12 @@ use CrestApps\CodeGenerator\Traits\CommonCommand; use CrestApps\CodeGenerator\Traits\ScaffoldTrait; use Illuminate\Console\Command; +use CrestApps\CodeGenerator\Support\Helpers; +use CrestApps\CodeGenerator\Traits\LanguageTrait; class CreateApiDocsScaffoldCommand extends command { - use ApiDocViewsTrait, CommonCommand, ScaffoldTrait; + use ApiDocViewsTrait, CommonCommand, ScaffoldTrait, LanguageTrait; /** * The console command description. @@ -169,7 +171,8 @@ protected function createLanguageFile($input) protected function getCommandInput() { $modelName = $this->argument('model-name'); - $controllerName = $this->option('controller-name'); + $cName = trim($this->option('controller-name')); + $controllerName = $cName ? Str::finish($cName, Config::getControllerNamePostFix()) : Helpers::makeControllerName($modelName . 'ApiDocs'); $prefix = $this->option('routes-prefix'); $resourceFile = $this->option('resource-file'); $force = $this->option('force'); diff --git a/src/Commands/ApiDocs/CreateApiDocsViewCommand.php b/src/Commands/ApiDocs/CreateApiDocsViewCommand.php index 27da053..5a84caa 100644 --- a/src/Commands/ApiDocs/CreateApiDocsViewCommand.php +++ b/src/Commands/ApiDocs/CreateApiDocsViewCommand.php @@ -35,15 +35,15 @@ class CreateApiDocsViewCommand extends Command */ protected $signature = 'api-docs:create-view {model-name : The model name that this controller will represent.} - {--controller-name= : The name of the controler.} + {--controller-name= : The name of the controller.} {--controller-directory= : The directory where the controller should be created under.} {--resource-file= : The name of the resource-file to import from.} {--routes-prefix=default-form : Prefix of the route group.} {--language-filename= : The languages file name to put the labels in.} - {--with-auth : Generate the controller with Laravel auth middlewear. } + {--with-auth : Generate the controller with Laravel auth middleware. } {--views-directory= : The name of the directory to create the views under.} - {--api-version= : The api version to prefix your resurces with.} - {--layout-name=layouts.api-doc-layout : This will extract the validation into a request form class.} + {--api-version= : The api version to prefix your resources with.} + {--layout-name=layouts.app : This will extract the validation into a request form class.} {--template-name= : The template name to use when generating the code.} {--force : This option will override the controller if one already exists.}'; @@ -205,7 +205,7 @@ protected function makeStandardSubView($name, $input, array $apiDocLabels, array } /** - * Gets the destenation file to be created. + * Gets the destination file to be created. * * @param string $name * @param string $path diff --git a/src/Commands/Bases/ViewsCommandBase.php b/src/Commands/Bases/ViewsCommandBase.php index c9e228c..e12722f 100644 --- a/src/Commands/Bases/ViewsCommandBase.php +++ b/src/Commands/Bases/ViewsCommandBase.php @@ -63,7 +63,7 @@ protected function getViewName() } /** - * It gets the views destenation path + * It gets the views destination path * * @param $viewsDirectory * @@ -119,7 +119,7 @@ protected function getDestinationViewFullname($viewsDirectory, $routesPrefix, $v } /** - * It generate the destenation view name + * It generate the destination view name * * @param $action * @@ -138,7 +138,7 @@ protected function getDestinationViewName($action) * * @return $this */ - protected function replaceCommonTemplates(&$stub, ViewInput $input, array $fields) + protected function replaceCommonTemplates(&$stub, $input, array $fields) { $viewLabels = new ViewLabelsGenerator($input->modelName, $fields, $this->isCollectiveTemplate()); @@ -222,7 +222,7 @@ protected function replaceFormName(&$stub, $name) /** * Get the view's name of a given file. * - * @param string $fillname + * @param string $filename * * @return string */ @@ -347,7 +347,7 @@ protected function createLanguageFile($langFile, $resourceFile, $modelName) } /** - * Gets destenation view path + * Gets destination view path * * @param string $viewsDirectory * @param string $routesPrefix @@ -413,7 +413,7 @@ protected function getHtmlGenerator(array $fields, $modelName, $template) } /** - * Replace the modele's header fo the given stub. + * Replace the model's header for the given stub. * * @param string $stub * @param string $title diff --git a/src/Commands/Views/CreateCreateViewCommand.php b/src/Commands/Views/CreateCreateViewCommand.php index 7d9cc75..a451779 100644 --- a/src/Commands/Views/CreateCreateViewCommand.php +++ b/src/Commands/Views/CreateCreateViewCommand.php @@ -48,6 +48,7 @@ protected function getStubName() protected function handleCreateView() { $input = $this->getCommandInput(); + $resources = Resource::fromFile($input->resourceFile, $input->languageFileName); $destenationFile = $this->getDestinationViewFullname($input->viewsDirectory, $input->prefix); @@ -68,7 +69,7 @@ protected function handleCreateView() } /** - * Gets te create form name + * Gets the create form name * * @param string $modelName * @@ -80,7 +81,7 @@ protected function getFormName($modelName) } /** - * Gets te create form id + * Gets the create form id * * @param string $modelName * diff --git a/src/Commands/Views/CreateFormViewCommand.php b/src/Commands/Views/CreateFormViewCommand.php index b2d2ef5..f09a1f2 100644 --- a/src/Commands/Views/CreateFormViewCommand.php +++ b/src/Commands/Views/CreateFormViewCommand.php @@ -48,6 +48,7 @@ protected function handleCreateView() { $input = $this->getCommandInput(); $resources = Resource::fromFile($input->resourceFile, $input->languageFileName); + $destenationFile = $this->getDestinationViewFullname($input->viewsDirectory, $input->prefix); if ($this->canCreateView($destenationFile, $input->force, $resources)) { diff --git a/src/Commands/Views/CreateIndexViewCommand.php b/src/Commands/Views/CreateIndexViewCommand.php index a58cde1..983ebe8 100644 --- a/src/Commands/Views/CreateIndexViewCommand.php +++ b/src/Commands/Views/CreateIndexViewCommand.php @@ -4,9 +4,13 @@ use CrestApps\CodeGenerator\Commands\Bases\ViewsCommandBase; use CrestApps\CodeGenerator\Models\Resource; +use CrestApps\CodeGenerator\Support\Helpers; +use CrestApps\CodeGenerator\Traits\LanguageTrait; class CreateIndexViewCommand extends ViewsCommandBase { + use LanguageTrait; + /** * The name and signature of the console command. * @@ -19,6 +23,7 @@ class CreateIndexViewCommand extends ViewsCommandBase {--routes-prefix=default-form : Prefix of the route group.} {--language-filename= : The name of the language file.} {--layout-name=layouts.app : This will extract the validation into a request form class.} + {--pagination-view-name=pagination : the name of the view to use for pagination.} {--template-name= : The template name to use when generating the code.} {--force : This option will override the view if one already exists.}'; @@ -47,9 +52,19 @@ protected function getStubName() protected function handleCreateView() { $input = $this->getCommandInput(); + $resources = Resource::fromFile($input->resourceFile, $input->languageFileName); $destenationFile = $this->getDestinationViewFullname($input->viewsDirectory, $input->prefix); + $paginationFileName = $this->getDestinationViewFullname($input->viewsDirectory, '', $input->paginationViewName); + + if(!$this->alreadyExists($paginationFileName)) + { + $pagerStub = $this->getStubContent('pagination.blade', $this->getTemplateName()); + + $this->createFile($paginationFileName, $pagerStub); + } + if ($this->canCreateView($destenationFile, $input->force, $resources)) { $stub = $this->getStub(); $htmlCreator = $this->getHtmlGenerator($resources->fields, $input->modelName, $this->getTemplateName()); @@ -59,11 +74,58 @@ protected function handleCreateView() ->replaceHeaderCells($stub, $htmlCreator->getIndexHeaderCells()) ->replaceBodyCells($stub, $htmlCreator->getIndexBodyCells()) ->replaceModelHeader($stub, $this->getHeaderFieldAccessor($resources->fields, $input->modelName)) + ->replacePaginationViewName($stub, $input->paginationViewName) ->createFile($destenationFile, $stub) ->info('Index view was crafted successfully.'); } } + /** + * Replaces the fillable for the given stub. + * + * @param string $stub + * @param string $fillable + * + * @return $this + */ + protected function replacePaginationViewName(&$stub, $name) + { + return $this->replaceTemplate('pagination_view_name', $name, $stub); + } + + /** + * Gets a clean user inputs. + * + * @return object + */ + protected function getCommandInput() + { + $options = $this->options(); + + $modelName = trim($this->arguments()['model-name']); + $resourceFile = trim($options['resource-file']) ?: Helpers::makeJsonFileName($modelName); + $viewsDirectory = trim($options['views-directory']); + $prefix = trim($options['routes-prefix']); + $prefix = ($prefix == 'default-form') ? Helpers::makeRouteGroup($modelName) : $prefix; + $force = $options['force']; + $languageFileName = trim($options['language-filename']) ?: self::makeLocaleGroup($modelName); + $layout = trim($options['layout-name']); + $template = trim($options['template-name']); + $paginationViewName = trim($options['pagination-view-name']); + + return (object) compact( + 'modelName', + 'prefix', + 'force', + 'resourceFile', + 'languageFileName', + 'layout', + 'template', + 'paginationViewName', + 'viewsDirectory' + ); + } + /** * Replaces the column headers in a given stub. * diff --git a/src/Commands/Views/CreateViewLayoutCommand.php b/src/Commands/Views/CreateViewLayoutCommand.php index 181cc09..0d741e6 100644 --- a/src/Commands/Views/CreateViewLayoutCommand.php +++ b/src/Commands/Views/CreateViewLayoutCommand.php @@ -25,7 +25,7 @@ class CreateViewLayoutCommand extends Command {--layout-directory=layouts : The directory of the layouts.} {--without-validation : This option will create a layout without client-side validation.} {--template-name= : The template name to use when generating the code.} - {--force : Override existsing layout.}'; + {--force : Override existing layout.}'; /** * The console command description. @@ -96,7 +96,7 @@ protected function fileExists($filename, $force) } /** - * Gets the destenation path. + * Gets the destination path. * * @param string $path * @@ -128,7 +128,7 @@ protected function getCommandInput() } /** - * Replaces the application'd name fo the given stub. + * Replaces the application's name for the given stub. * * @param string $stub * @param string $appName diff --git a/src/Models/ViewInput.php b/src/Models/ViewInput.php index ef4bac8..bf02a31 100644 --- a/src/Models/ViewInput.php +++ b/src/Models/ViewInput.php @@ -31,7 +31,7 @@ class ViewInput public $viewsDirectory; /** - * The provided route's pre-fix + * The provided route's prefix * * @var string */ @@ -77,7 +77,7 @@ public function __construct(array $arguments, array $options = []) } /** - * Gets array of the paramets + * Gets array of the parameters * * @return array */ diff --git a/src/Traits/CommonCommand.php b/src/Traits/CommonCommand.php index 92c1f86..4530d5b 100644 --- a/src/Traits/CommonCommand.php +++ b/src/Traits/CommonCommand.php @@ -295,7 +295,7 @@ protected function getStubByName($name, $template = null) protected function replaceRouteNames(&$stub, $modelName, $routesPrefix, array $actions = null) { foreach (($actions ?: $this->actions) as $action) { - $routeName = $this->getDotNotationName($modelName, $routesPrefix, $action); + $routeName = $this->getDotNotationName($this->getModelName($modelName), $routesPrefix, $action); $routeTemplate = $this->getRouteName($action); $stub = $this->strReplace($routeTemplate, $routeName, $stub); } diff --git a/templates/default-collective/api-documentation-index.stub b/templates/default-collective/api-documentation-index.stub index 00d7519..2816e9f 100644 --- a/templates/default-collective/api-documentation-index.stub +++ b/templates/default-collective/api-documentation-index.stub @@ -7,411 +7,380 @@

[% available_resources %]

-
-
- -
-
GET
- /{{ Route::getRoutes()->getByName('[% index_route_name %]')->uri() }} - [% index_route_description %] -
-
- - - -
+
+
+
+ GET + /{{ Route::getRoutes()->getByName('[% index_route_name %]')->uri() }} +

[% index_route_description %]

- -
-
-

[% request_title %]

- [% authorized_request_for_index %] - -
-

[% response_title %]

- -

[% index_route_response_description %]

-

- -

200 - Ok

-

[% request_was_successful %]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
success[% boolean_title %]Was the request successful or not.
message[% string_title %][% the_success_message %]
data[% array_title %] - [% the_key_is_the_model_property_and_the_value_is_the_model_value %] -
links[% array_title %] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[% key_title %][% data_type_title %][% description_title %]
first[% string_title %][% link_to_retrieve_first_page %]
last[% string_title %][% link_to_retrieve_last_page %]
prev[% string_title %][% link_to_retrieve_previous_page %]
next[% string_title %][% link_to_retrieve_next_page %]
- -
meta[% array_title %] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[% key_title %][% data_type_title %][% description_title %]
current_page[% integer_title %][% the_number_of_current_page %]
from[% integer_title %][% the_index_of_the_first_retrieved_item %]
last_page[% integer_title %][% the_number_of_the_last_page %]
Path[% string_title %][% the_base_link_to_the_resource %]
per_page[% integer_title %][% the_number_of_models_per_page %]
to[% integer_title %][% the_index_of_the_last_retrieved_item %]
total[% integer_title %][% the_total_of_available_pages %]
- -
- - [% include_failed_authentication_for_authorized_request %] - -
+
+
+
+

[% request_title %]

+ [% authorized_request_for_index %] + +
+

[% response_title %]

+ +

[% index_route_response_description %]

+

+ +

200 - Ok

+

[% request_was_successful %]

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
success[% boolean_title %]Was the request successful or not.
message[% string_title %][% the_success_message %]
data[% array_title %] + [% the_key_is_the_model_property_and_the_value_is_the_model_value %] +
links[% array_title %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[% key_title %][% data_type_title %][% description_title %]
first[% string_title %][% link_to_retrieve_first_page %]
last[% string_title %][% link_to_retrieve_last_page %]
prev[% string_title %][% link_to_retrieve_previous_page %]
next[% string_title %][% link_to_retrieve_next_page %]
+ +
meta[% array_title %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[% key_title %][% data_type_title %][% description_title %]
current_page[% integer_title %][% the_number_of_current_page %]
from[% integer_title %][% the_index_of_the_first_retrieved_item %]
last_page[% integer_title %][% the_number_of_the_last_page %]
Path[% string_title %][% the_base_link_to_the_resource %]
per_page[% integer_title %][% the_number_of_models_per_page %]
to[% integer_title %][% the_index_of_the_last_retrieved_item %]
total[% integer_title %][% the_total_of_available_pages %]
+ +
+ + [% include_failed_authentication_for_authorized_request %] -
-
- -
-
POST
- /{{ Route::getRoutes()->getByName('[% store_route_name %]')->uri() }} - [% store_route_description %] -
-
+
+
- -
+
+
+
+ POST + /{{ Route::getRoutes()->getByName('[% store_route_name %]')->uri() }} +

[% store_route_description %]

- -
-
-

[% request_title %]

- - @include('[% path_to_view_home %]fields-list', [ - 'withValidation' => true - ]) - -
-

[% response_title %]

-

[% store_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - @include('[% path_to_view_home %]failed-validation') - [% include_failed_authentication_for_authorized_request %] - -
+
+
+
+

[% request_title %]

+ + @include('[% path_to_view_home %]fields-list', [ + 'withValidation' => true + ]) +
+

[% response_title %]

+

[% store_route_response_description %]

+

-
-
+ @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + @include('[% path_to_view_home %]failed-validation') + [% include_failed_authentication_for_authorized_request %] + +
+
-
-
POST
- /{{ Route::getRoutes()->getByName('[% update_route_name %]')->uri() }} - [% update_route_description %] -
-
- -
+
+
+
+ POST + /{{ Route::getRoutes()->getByName('[% update_route_name %]')->uri() }} +

[% update_route_description %]

+
+
+
+
-
-
+
+
-

[% request_title %]

+

[% request_title %]

- @include('[% path_to_view_home %]fields-list', [ - 'withValidation' => true, - 'withPathId' => true, - ]) + @include('[% path_to_view_home %]fields-list', [ + 'withValidation' => true, + 'withPathId' => true, + ]) -
-

[% response_title %]

-

[% update_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - @include('[% path_to_view_home %]failed-validation') - [% include_failed_authentication_for_authorized_request %] +
+

[% response_title %]

+

[% update_route_response_description %]

+

+ + @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + @include('[% path_to_view_home %]failed-validation') + [% include_failed_authentication_for_authorized_request %] -
+
-
-
- -
-
GET
- /{{ Route::getRoutes()->getByName('[% show_route_name %]')->uri() }} - [% show_route_description %] -
-
- - - - -
+
+
+
+ GET + /{{ Route::getRoutes()->getByName('[% show_route_name %]')->uri() }} +

[% show_route_description %]

- -
-
- -

[% request_title %]

- - - - - - - - - - - - [% include_parameter_for_authorized_request %] - - - - - - - -
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
[% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_retrieve %]
- - -
-

[% response_title %]

-

[% show_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - [% include_failed_authentication_for_authorized_request %] - -
+
+
+
+ +

[% request_title %]

+ + + + + + + + + + + + [% include_parameter_for_authorized_request %] + + + + + + + +
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
[% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_retrieve %]
+ + +
+

[% response_title %]

+

[% show_route_response_description %]

+

+ + @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + [% include_failed_authentication_for_authorized_request %] +
+
-
-
- -
-
DELETE
- /{{ Route::getRoutes()->getByName('[% destroy_route_name %]')->uri() }} - [% destroy_route_description %] -
-
- - -
+
+
+
+ DELETE + /{{ Route::getRoutes()->getByName('[% destroy_route_name %]')->uri() }} +

[% destroy_route_description %]

- -
-
- -

[% request_title %]

- - - - - - - - - - - - [% include_parameter_for_authorized_request %] - - - - - - - -
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
[% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_delete %]
- - -
-

[% response_title %]

-

[% destroy_route_response_description %]

-

- - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - [% include_failed_authentication_for_authorized_request %] - -
+
+
-
+
+ +

[% request_title %]

+ + + + + + + + + + + + [% include_parameter_for_authorized_request %] + + + + + + + +
[% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
[% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_delete %]
+ + +
+

[% response_title %]

+

[% destroy_route_response_description %]

+

+ + @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + [% include_failed_authentication_for_authorized_request %] -

[% model_definition_title %]

-
-
+
-
- [% model_name_title %] -
-
+
- +
-
+

[% model_definition_title %]

+
+
+
+ [% model_name_title %]
- -
-
- - - - - - - - - - [% fields_list_for_body %] - -
[% field_name_title %][% field_type_title %][% description_title %]
-
+
+
-
+
+ + + + + + + + + + [% fields_list_for_body %] + +
[% field_name_title %][% field_type_title %][% description_title %]
+
+
@endsection diff --git a/templates/default-collective/controller-affirm-method.stub b/templates/default-collective/controller-affirm-method.stub index 7e76d9d..7d4f94f 100644 --- a/templates/default-collective/controller-affirm-method.stub +++ b/templates/default-collective/controller-affirm-method.stub @@ -2,7 +2,7 @@ /** * Validate the given request with the defined rules. * - * @param [% request_fullname %] $request + * @param [% request_fullname %] $request * * @return boolean */ diff --git a/templates/default-collective/controller-upload-method-5.3.stub b/templates/default-collective/controller-upload-method-5.3.stub index 69c3e91..45b9a51 100644 --- a/templates/default-collective/controller-upload-method-5.3.stub +++ b/templates/default-collective/controller-upload-method-5.3.stub @@ -2,7 +2,7 @@ /** * Moves the attached file to the server. * - * @param Symfony\Component\HttpFoundation\File\UploadedFile $file + * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file * * @return string */ @@ -12,9 +12,8 @@ return ''; } - $fileName = sprintf('%s.%s', uniqid(), $file->getClientOriginalExtension()); - $destinationPath = config('laravel-code-generator.files_upload_path','uploads'); - $path = $file->move($destinationPath, $fileName); - - return $destinationPath . '/' . $fileName; - } \ No newline at end of file + $path = config('laravel-code-generator.files_upload_path', 'uploads'); + $saved = $file->store('public/' . $path, config('filesystems.default')); + + return substr($saved, 7); + } diff --git a/templates/default-collective/controller-upload-method.stub b/templates/default-collective/controller-upload-method.stub index 69c3e91..3354a45 100644 --- a/templates/default-collective/controller-upload-method.stub +++ b/templates/default-collective/controller-upload-method.stub @@ -2,7 +2,7 @@ /** * Moves the attached file to the server. * - * @param Symfony\Component\HttpFoundation\File\UploadedFile $file + * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file * * @return string */ diff --git a/templates/default-collective/controller.stub b/templates/default-collective/controller.stub index cbe851c..bbdb6b6 100644 --- a/templates/default-collective/controller.stub +++ b/templates/default-collective/controller.stub @@ -11,7 +11,7 @@ class [% controller_name %] [% controller_extends %] /** * Display a listing of the [% model_name_plural %]. * - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function index() { @@ -23,7 +23,7 @@ class [% controller_name %] [% controller_extends %] /** * Show the form for creating a new [% model_name %]. * - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function create() { @@ -37,7 +37,7 @@ class [% controller_name %] [% controller_extends %] * * @param [% request_fullname %] [% request_variable %] * - * @return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector + * @return \Illuminate\Http\RedirectResponse | \Illuminate\Routing\Redirector */ public function store([% type_hinted_request_name %]) { @@ -61,7 +61,7 @@ class [% controller_name %] [% controller_extends %] * * @param int $id * - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function show($id) { @@ -75,7 +75,7 @@ class [% controller_name %] [% controller_extends %] * * @param int $id * - * @return Illuminate\View\View + * @return \Illuminate\View\View */ public function edit($id) { @@ -88,10 +88,10 @@ class [% controller_name %] [% controller_extends %] /** * Update the specified [% model_name %] in the storage. * - * @param int $id + * @param int $id * @param [% request_fullname %] [% request_variable %] * - * @return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector + * @return \Illuminate\Http\RedirectResponse | \Illuminate\Routing\Redirector */ public function update($id, [% type_hinted_request_name %]) { @@ -114,9 +114,9 @@ class [% controller_name %] [% controller_extends %] /** * Remove the specified [% model_name %] from the storage. * - * @param int $id + * @param int $id * - * @return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector + * @return \Illuminate\Http\RedirectResponse | \Illuminate\Routing\Redirector */ public function destroy($id) { diff --git a/templates/default-collective/create.blade.stub b/templates/default-collective/create.blade.stub index be65568..130b761 100644 --- a/templates/default-collective/create.blade.stub +++ b/templates/default-collective/create.blade.stub @@ -2,25 +2,18 @@ @section('content') -
- -
- -
-

[% create_model %]

-
- -
+
+
+

[% create_model %]

+ -
-
+
@if ($errors->any())
    @@ -32,7 +25,6 @@ {!! Form::open([ 'route' => '[% store_route_name %]', - 'class' => 'form-horizontal', 'name' => '[% form_name %]', 'id' => '[% form_id %]', [% upload_files %] @@ -40,10 +32,8 @@ !!} @include ('[% form_view_name %]', ['[% model_name_singular_variable %]' => null,]) -
    -
    - {!! Form::submit([% add %], ['class' => 'btn btn-primary']) !!} -
    +
    + {!! Form::submit([% add %], ['class' => 'btn btn-primary']) !!}
    {!! Form::close() !!} diff --git a/templates/default-collective/edit.blade.stub b/templates/default-collective/edit.blade.stub index 3dcc739..e3ae582 100644 --- a/templates/default-collective/edit.blade.stub +++ b/templates/default-collective/edit.blade.stub @@ -2,28 +2,22 @@ @section('content') -
    - -
    - -
    -

    {{ !empty([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}

    -
    - -
    +
    +
    +

    {{ !empty([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}

    +
    -
    +
    @if ($errors->any())
      @@ -36,7 +30,6 @@ {!! Form::model($[% model_name_singular_variable %], [ 'method' => 'PUT', 'route' => ['[% update_route_name %]', $[% model_name_singular_variable %]->[% primary_key %]], - 'class' => 'form-horizontal', 'name' => '[% form_name %]', 'id' => '[% form_id %]', [% upload_files %] @@ -44,10 +37,8 @@ @include ('[% form_view_name %]', ['[% model_name_singular_variable %]' => $[% model_name_singular_variable %],]) -
      -
      - {!! Form::submit([% update %], ['class' => 'btn btn-primary']) !!} -
      +
      + {!! Form::submit([% update %], ['class' => 'btn btn-primary']) !!}
      {!! Form::close() !!} diff --git a/templates/default-collective/form-file-field.blade.stub b/templates/default-collective/form-file-field.blade.stub index f986e18..e3c380b 100644 --- a/templates/default-collective/form-file-field.blade.stub +++ b/templates/default-collective/form-file-field.blade.stub @@ -1,20 +1,14 @@ -
      - - +
      +
      @if (isset($[% model_name_singular_variable %]->[% field_name %]) && !empty($[% model_name_singular_variable %]->[% field_name %])) -
      - - Delete - - - {{ [% field_value %] }} - -
      - @endif \ No newline at end of file +
      +
      + +
      + +
      + + @endif diff --git a/templates/default-collective/form-helper-field.blade.stub b/templates/default-collective/form-helper-field.blade.stub index 51928cb..8f5e5c4 100644 --- a/templates/default-collective/form-helper-field.blade.stub +++ b/templates/default-collective/form-helper-field.blade.stub @@ -1 +1 @@ - {!! $errors->first('[% field_name %]', '

      :message

      ') !!} \ No newline at end of file + {!! $errors->first('[% field_name %]', '

      :message

      ') !!} \ No newline at end of file diff --git a/templates/default-collective/form-input-wrapper.blade.stub b/templates/default-collective/form-input-wrapper.blade.stub index 23c42f3..b2ec1ca 100644 --- a/templates/default-collective/form-input-wrapper.blade.stub +++ b/templates/default-collective/form-input-wrapper.blade.stub @@ -1,5 +1,5 @@ -
      +
      [% field_label %]
      [% field_input %] diff --git a/templates/default-collective/form-label-field.blade.stub b/templates/default-collective/form-label-field.blade.stub index 5ae8c70..1105271 100644 --- a/templates/default-collective/form-label-field.blade.stub +++ b/templates/default-collective/form-label-field.blade.stub @@ -1 +1 @@ - {!! Form::label('[% field_name %]',[% field_title %],['class' => 'col-md-2 control-label']) !!} \ No newline at end of file + {!! Form::label('[% field_name %]',[% field_title %],['class' => 'col-form-label text-lg-end col-lg-2 col-xl-3']) !!} \ No newline at end of file diff --git a/templates/default-collective/form-month-field.blade.stub b/templates/default-collective/form-month-field.blade.stub index 4e7cde7..4a2655e 100644 --- a/templates/default-collective/form-month-field.blade.stub +++ b/templates/default-collective/form-month-field.blade.stub @@ -1 +1 @@ - {!! Form::selectMonth('[% field_name %]', [% selected_value %], ['class' => 'form-control[% css_class %]']) !!} \ No newline at end of file + {!! Form::selectMonth('[% field_name %]', [% selected_value %], ['class' => 'form-select[% css_class %]']) !!} \ No newline at end of file diff --git a/templates/default-collective/form-nolabel-field.blade.stub b/templates/default-collective/form-nolabel-field.blade.stub index 78460f9..e1ad396 100644 --- a/templates/default-collective/form-nolabel-field.blade.stub +++ b/templates/default-collective/form-nolabel-field.blade.stub @@ -1 +1 @@ -
      \ No newline at end of file +
      \ No newline at end of file diff --git a/templates/default-collective/form-pickitems-field.blade.stub b/templates/default-collective/form-pickitems-field.blade.stub index d15e520..32dab80 100644 --- a/templates/default-collective/form-pickitems-field.blade.stub +++ b/templates/default-collective/form-pickitems-field.blade.stub @@ -1,6 +1,7 @@ -
      -
      + \ No newline at end of file diff --git a/templates/default-collective/form-pickitems-inline-field.blade.stub b/templates/default-collective/form-pickitems-inline-field.blade.stub index e594e19..7053eaf 100644 --- a/templates/default-collective/form-pickitems-inline-field.blade.stub +++ b/templates/default-collective/form-pickitems-inline-field.blade.stub @@ -1,4 +1,6 @@ - +
      + {!! Form::[% field_type %]('[% field_name %]', '[% option_value %]', [% checked_item %], ['id' => '[% item_id %]', 'class' => 'form-check-input[% required_class %][% css_class %]', [% required_field %] ]) !!} + +
      diff --git a/templates/default-collective/form-selectmenu-field.blade.stub b/templates/default-collective/form-selectmenu-field.blade.stub index 75777bb..f04d5bc 100644 --- a/templates/default-collective/form-selectmenu-field.blade.stub +++ b/templates/default-collective/form-selectmenu-field.blade.stub @@ -1 +1 @@ - {!! Form::select('[% field_name %]',[% field_items %],[% field_value %], ['class' => 'form-control[% css_class %]',[% field_multiple %][% required_field %][% placeholder %] ]) !!} \ No newline at end of file + {!! Form::select('[% field_name %]',[% field_items %],[% field_value %], ['class' => 'form-select[% css_class %]',[% field_multiple %][% required_field %][% placeholder %] ]) !!} \ No newline at end of file diff --git a/templates/default-collective/form-selectrange-field.blade.stub b/templates/default-collective/form-selectrange-field.blade.stub index 65065b5..da33c9e 100644 --- a/templates/default-collective/form-selectrange-field.blade.stub +++ b/templates/default-collective/form-selectrange-field.blade.stub @@ -1 +1 @@ - {!! Form::selectRange('[% field_name %]', [% min_value %], [% max_value %], [% selected_value %], ['class' => 'form-control[% css_class %]']) !!} \ No newline at end of file + {!! Form::selectRange('[% field_name %]', [% min_value %], [% max_value %], [% selected_value %], ['class' => 'form-select[% css_class %]']) !!} \ No newline at end of file diff --git a/templates/default-collective/index.blade.stub b/templates/default-collective/index.blade.stub index 769cc6e..f5a5d9c 100644 --- a/templates/default-collective/index.blade.stub +++ b/templates/default-collective/index.blade.stub @@ -3,44 +3,33 @@ @section('content') @if(Session::has('success_message')) -
      - + @endif -
      - -
      - -
      -

      [% model_name_plural_title %]

      -
      +
      -
      - - - + @if(count($[% model_name_plural_variable %]) == 0) -
      +

      [% no_models_available %]

      @else -
      +
      - +
      [% header_cells %] @@ -51,31 +40,27 @@ @foreach($[% model_name_plural_variable %] as $[% model_name_singular_variable %]) [% body_cells %] - @endforeach @@ -84,13 +69,10 @@ + {!! $[% model_name_plural_variable %]->links('[% pagination_view_name %]') !!} - - - + @endif - + -@endsection \ No newline at end of file +@endsection diff --git a/templates/default-collective/layout-with-validation.stub b/templates/default-collective/layout-with-validation.stub index 7271626..281c2aa 100644 --- a/templates/default-collective/layout-with-validation.stub +++ b/templates/default-collective/layout-with-validation.stub @@ -1,182 +1,194 @@ - - - - - - - - {{ config('app.name', '[% application_name %]') }} - - - - - {{-- --}} - - - - - - - - + + + + + + + {{ config('app.name', '[% application_name %]') }} + - - {{-- --}} - + + + {{-- --}} + + + + - }); - +
      + @yield('content') +
      - + + {{-- --}} + diff --git a/templates/default-collective/layout.stub b/templates/default-collective/layout.stub index 3b78180..281c2aa 100644 --- a/templates/default-collective/layout.stub +++ b/templates/default-collective/layout.stub @@ -1,149 +1,194 @@ - - - - - - - - {{ config('app.name', '[% application_name %]') }} - - - - - {{-- --}} - - - - - - - - + + + + + + + {{ config('app.name', '[% application_name %]') }} + + localStorage.setItem(key, JSON.stringify(adminPreferences)); + Cookies.set(key, JSON.stringify(adminPreferences), { expires: 360 }); + }; - {{-- --}} - - - + + const themeSwitcherText = document.querySelector('#bd-theme-text'); + const activeThemeIcon = document.querySelector('.theme-icon-active'); + const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`); + const svgOfActiveBtn = btnToActive.querySelector('.theme-icon'); + + btnToActive.classList.add('active'); + btnToActive.setAttribute('aria-pressed', 'true'); + + activeThemeIcon.innerHTML = svgOfActiveBtn.innerHTML; + + const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`; + themeSwitcher.setAttribute('aria-label', themeSwitcherLabel); + + const btnsToInactive = document.querySelectorAll(`[data-bs-theme-value]:not([data-bs-theme-value="${theme}"])`); + + for (let i = 0; i < btnsToInactive.length; i++) { + btnsToInactive[i].classList.remove('active'); + btnsToInactive[i].setAttribute('aria-pressed', 'false'); + } + + if (focus) { + themeSwitcher.focus(); + } + } + + window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { + const storedTheme = getStoredTheme() + if (storedTheme !== lightThemeName && storedTheme !== darkThemeName) { + setTheme(getPreferredTheme()); + } + }); + + window.addEventListener('DOMContentLoaded', () => { + showActiveTheme(getPreferredTheme()); + + document.querySelectorAll('[data-bs-theme-value]') + .forEach(toggle => { + toggle.addEventListener('click', () => { + const theme = toggle.getAttribute('data-bs-theme-value'); + setStoredTheme(theme); + setTheme(theme); + showActiveTheme(theme, true); + }) + }) + }); + + + + {{-- --}} + + + + + +
      + @yield('content') +
      + + + {{-- --}} + diff --git a/templates/default-collective/show.blade.stub b/templates/default-collective/show.blade.stub index 34a4698..94f910b 100644 --- a/templates/default-collective/show.blade.stub +++ b/templates/default-collective/show.blade.stub @@ -2,8 +2,8 @@ @section('content') -
      -
      +
      +

      {{ isset([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}

      @@ -17,18 +17,18 @@ ]) !!}
      - + - + - + - {!! Form::button('', + {!! Form::button('', [ 'type' => 'submit', 'class' => 'btn btn-danger', @@ -43,7 +43,7 @@
      -
      +
      [% table_rows %]
      diff --git a/templates/default/api-documentation-index.stub b/templates/default/api-documentation-index.stub index 00d7519..2816e9f 100644 --- a/templates/default/api-documentation-index.stub +++ b/templates/default/api-documentation-index.stub @@ -7,411 +7,380 @@

      [% available_resources %]

      -
      -
      - -
      -
      GET
      - /{{ Route::getRoutes()->getByName('[% index_route_name %]')->uri() }} - [% index_route_description %] -
      -
      - - - -
      +
      +
      +
      + GET + /{{ Route::getRoutes()->getByName('[% index_route_name %]')->uri() }} +

      [% index_route_description %]

      - -
      -
      -

      [% request_title %]

      - [% authorized_request_for_index %] - -
      -

      [% response_title %]

      - -

      [% index_route_response_description %]

      -

      - -

      200 - Ok

      -

      [% request_was_successful %]

      -
      + - {!! Form::open([ - 'method' =>'DELETE', - 'route' => ['[% destroy_route_name %]', $[% model_name_singular_variable %]->[% primary_key %]], - 'style' => 'display: inline;', - ]) !!} -
      +
      + + {{ csrf_field() }} + +
      - + - + - {!! Form::button('', - [ - 'type' => 'submit', - 'class' => 'btn btn-danger', - 'title' => [% delete_model %], - 'onclick' => 'return confirm("' . [% confirm_delete %] . '")' - ]) - !!} +
      - {!! Form::close() !!} + +
      +
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      success[% boolean_title %]Was the request successful or not.
      message[% string_title %][% the_success_message %]
      data[% array_title %] - [% the_key_is_the_model_property_and_the_value_is_the_model_value %] -
      links[% array_title %] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      [% key_title %][% data_type_title %][% description_title %]
      first[% string_title %][% link_to_retrieve_first_page %]
      last[% string_title %][% link_to_retrieve_last_page %]
      prev[% string_title %][% link_to_retrieve_previous_page %]
      next[% string_title %][% link_to_retrieve_next_page %]
      - -
      meta[% array_title %] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      [% key_title %][% data_type_title %][% description_title %]
      current_page[% integer_title %][% the_number_of_current_page %]
      from[% integer_title %][% the_index_of_the_first_retrieved_item %]
      last_page[% integer_title %][% the_number_of_the_last_page %]
      Path[% string_title %][% the_base_link_to_the_resource %]
      per_page[% integer_title %][% the_number_of_models_per_page %]
      to[% integer_title %][% the_index_of_the_last_retrieved_item %]
      total[% integer_title %][% the_total_of_available_pages %]
      - -
      - - [% include_failed_authentication_for_authorized_request %] - -
      +
      +
      +
      +

      [% request_title %]

      + [% authorized_request_for_index %] + +
      +

      [% response_title %]

      + +

      [% index_route_response_description %]

      +

      + +

      200 - Ok

      +

      [% request_was_successful %]

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      success[% boolean_title %]Was the request successful or not.
      message[% string_title %][% the_success_message %]
      data[% array_title %] + [% the_key_is_the_model_property_and_the_value_is_the_model_value %] +
      links[% array_title %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      [% key_title %][% data_type_title %][% description_title %]
      first[% string_title %][% link_to_retrieve_first_page %]
      last[% string_title %][% link_to_retrieve_last_page %]
      prev[% string_title %][% link_to_retrieve_previous_page %]
      next[% string_title %][% link_to_retrieve_next_page %]
      + +
      meta[% array_title %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      [% key_title %][% data_type_title %][% description_title %]
      current_page[% integer_title %][% the_number_of_current_page %]
      from[% integer_title %][% the_index_of_the_first_retrieved_item %]
      last_page[% integer_title %][% the_number_of_the_last_page %]
      Path[% string_title %][% the_base_link_to_the_resource %]
      per_page[% integer_title %][% the_number_of_models_per_page %]
      to[% integer_title %][% the_index_of_the_last_retrieved_item %]
      total[% integer_title %][% the_total_of_available_pages %]
      + +
      + + [% include_failed_authentication_for_authorized_request %] -
      -
      - -
      -
      POST
      - /{{ Route::getRoutes()->getByName('[% store_route_name %]')->uri() }} - [% store_route_description %] -
      -
      +
      +
      - -
      +
      +
      +
      + POST + /{{ Route::getRoutes()->getByName('[% store_route_name %]')->uri() }} +

      [% store_route_description %]

      - -
      -
      -

      [% request_title %]

      - - @include('[% path_to_view_home %]fields-list', [ - 'withValidation' => true - ]) - -
      -

      [% response_title %]

      -

      [% store_route_response_description %]

      -

      - - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - @include('[% path_to_view_home %]failed-validation') - [% include_failed_authentication_for_authorized_request %] - -
      +
      +
      +
      +

      [% request_title %]

      + + @include('[% path_to_view_home %]fields-list', [ + 'withValidation' => true + ]) +
      +

      [% response_title %]

      +

      [% store_route_response_description %]

      +

      -
      -
      + @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + @include('[% path_to_view_home %]failed-validation') + [% include_failed_authentication_for_authorized_request %] + +
      +
      -
      -
      POST
      - /{{ Route::getRoutes()->getByName('[% update_route_name %]')->uri() }} - [% update_route_description %] -
      -
      - -
      +
      +
      +
      + POST + /{{ Route::getRoutes()->getByName('[% update_route_name %]')->uri() }} +

      [% update_route_description %]

      +
      +
      +
      +
      -
      -
      +
      +
      -

      [% request_title %]

      +

      [% request_title %]

      - @include('[% path_to_view_home %]fields-list', [ - 'withValidation' => true, - 'withPathId' => true, - ]) + @include('[% path_to_view_home %]fields-list', [ + 'withValidation' => true, + 'withPathId' => true, + ]) -
      -

      [% response_title %]

      -

      [% update_route_response_description %]

      -

      - - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - @include('[% path_to_view_home %]failed-validation') - [% include_failed_authentication_for_authorized_request %] +
      +

      [% response_title %]

      +

      [% update_route_response_description %]

      +

      + + @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + @include('[% path_to_view_home %]failed-validation') + [% include_failed_authentication_for_authorized_request %] -
      +
      -
      -
      - -
      -
      GET
      - /{{ Route::getRoutes()->getByName('[% show_route_name %]')->uri() }} - [% show_route_description %] -
      -
      - - - - -
      +
      +
      +
      + GET + /{{ Route::getRoutes()->getByName('[% show_route_name %]')->uri() }} +

      [% show_route_description %]

      - -
      -
      - -

      [% request_title %]

      - - - - - - - - - - - - [% include_parameter_for_authorized_request %] - - - - - - - -
      [% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
      [% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_retrieve %]
      - - -
      -

      [% response_title %]

      -

      [% show_route_response_description %]

      -

      - - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - [% include_failed_authentication_for_authorized_request %] - -
      +
      +
      +
      + +

      [% request_title %]

      + + + + + + + + + + + + [% include_parameter_for_authorized_request %] + + + + + + + +
      [% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
      [% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_retrieve %]
      + + +
      +

      [% response_title %]

      +

      [% show_route_response_description %]

      +

      + + @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + [% include_failed_authentication_for_authorized_request %] +
      +
      -
      -
      - -
      -
      DELETE
      - /{{ Route::getRoutes()->getByName('[% destroy_route_name %]')->uri() }} - [% destroy_route_description %] -
      -
      - - -
      +
      +
      +
      + DELETE + /{{ Route::getRoutes()->getByName('[% destroy_route_name %]')->uri() }} +

      [% destroy_route_description %]

      - -
      -
      - -

      [% request_title %]

      - - - - - - - - - - - - [% include_parameter_for_authorized_request %] - - - - - - - -
      [% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
      [% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_delete %]
      - - -
      -

      [% response_title %]

      -

      [% destroy_route_response_description %]

      -

      - - @include('[% path_to_view_home %]retrieved') - @include('[% path_to_view_home %]failed-to-retrieve') - [% include_failed_authentication_for_authorized_request %] - -
      +
      +
      -
      +
      + +

      [% request_title %]

      + + + + + + + + + + + + [% include_parameter_for_authorized_request %] + + + + + + + +
      [% parameter_name_title %][% data_type_title %][% parameter_type_title %][% description_title %]
      [% model_name %][% integer_title %][% path_title %][% the_id_of_model_to_delete %]
      + + +
      +

      [% response_title %]

      +

      [% destroy_route_response_description %]

      +

      + + @include('[% path_to_view_home %]retrieved') + @include('[% path_to_view_home %]failed-to-retrieve') + [% include_failed_authentication_for_authorized_request %] -

      [% model_definition_title %]

      -
      -
      +
      -
      - [% model_name_title %] -
      -
      +
      - +
      -
      +

      [% model_definition_title %]

      +
      +
      +
      + [% model_name_title %]
      - -
      -
      - - - - - - - - - - [% fields_list_for_body %] - -
      [% field_name_title %][% field_type_title %][% description_title %]
      -
      +
      +
      -
      +
      + + + + + + + + + + [% fields_list_for_body %] + +
      [% field_name_title %][% field_type_title %][% description_title %]
      +
      +
      @endsection diff --git a/templates/default/create.blade.stub b/templates/default/create.blade.stub index 3c274ec..b791626 100644 --- a/templates/default/create.blade.stub +++ b/templates/default/create.blade.stub @@ -2,23 +2,19 @@ @section('content') -
      +
      -
      - - -

      [% create_model %]

      -
      - -
      +
      +

      [% create_model %]

      + -
      + -
      +
      @if ($errors->any())
        @@ -28,16 +24,14 @@
      @endif -
      + {{ csrf_field() }} @include ('[% form_view_name %]', [ '[% model_name_singular_variable %]' => null, ]) -
      -
      - -
      +
      +
      diff --git a/templates/default/edit.blade.stub b/templates/default/edit.blade.stub index ef0e382..d400c98 100644 --- a/templates/default/edit.blade.stub +++ b/templates/default/edit.blade.stub @@ -2,27 +2,22 @@ @section('content') -
      +
      -
      - -
      -

      {{ !empty([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}

      -
      -
      - +
      +

      {{ !empty([% model_header %]) ? [% model_header %] : '[% model_name_title %]' }}

      +
      -
      +
      @if ($errors->any())
        @@ -32,17 +27,15 @@
      @endif -
      + {{ csrf_field() }} @include ('[% form_view_name %]', [ '[% model_name_singular_variable %]' => $[% model_name_singular_variable %], ]) -
      -
      - -
      +
      +
      diff --git a/templates/default/form-file-field.blade.stub b/templates/default/form-file-field.blade.stub index f986e18..e3c380b 100644 --- a/templates/default/form-file-field.blade.stub +++ b/templates/default/form-file-field.blade.stub @@ -1,20 +1,14 @@ -
      - - +
      +
      @if (isset($[% model_name_singular_variable %]->[% field_name %]) && !empty($[% model_name_singular_variable %]->[% field_name %])) -
      - - Delete - - - {{ [% field_value %] }} - -
      - @endif \ No newline at end of file +
      +
      + +
      + +
      + + @endif diff --git a/templates/default/form-helper-field.blade.stub b/templates/default/form-helper-field.blade.stub index 51928cb..8f5e5c4 100644 --- a/templates/default/form-helper-field.blade.stub +++ b/templates/default/form-helper-field.blade.stub @@ -1 +1 @@ - {!! $errors->first('[% field_name %]', '

      :message

      ') !!} \ No newline at end of file + {!! $errors->first('[% field_name %]', '

      :message

      ') !!} \ No newline at end of file diff --git a/templates/default/form-input-wrapper.blade.stub b/templates/default/form-input-wrapper.blade.stub index 23c42f3..1fcacc6 100644 --- a/templates/default/form-input-wrapper.blade.stub +++ b/templates/default/form-input-wrapper.blade.stub @@ -1,7 +1,7 @@ -
      +
      [% field_label %] -
      +
      [% field_input %] [% field_validation_helper %]
      diff --git a/templates/default/form-label-field.blade.stub b/templates/default/form-label-field.blade.stub index 73505ca..b48e5f3 100644 --- a/templates/default/form-label-field.blade.stub +++ b/templates/default/form-label-field.blade.stub @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/templates/default/form-month-field.blade.stub b/templates/default/form-month-field.blade.stub index cbe7a2c..72b475a 100644 --- a/templates/default/form-month-field.blade.stub +++ b/templates/default/form-month-field.blade.stub @@ -1,4 +1,4 @@ - [% placeholder %] @foreach (range(1, 12) as $value)