Closed BurningDog closed 2 years ago
@BurningDog
it's already menstion in docs.
https://infyom.com/open-source/laravelgenerator/docs/8.0/installation#add-packages
@BurningDog This is not a valid issue. you need to refer docs properly. These files are generated by the command, you should review this doc. or you can watch tutorials here https://www.youtube.com/playlist?list=PL0wCC44AhrC3JHzcB5qmjYkm70OaoKegg https://infyom.com/open-source/laravelgenerator/docs/8.0/installation#publish
@BurningDog it's depend on OS
@BurningDog it would be good to give more details for the following issue. which files are not rollbacked? The rollback command doesn't roll back all files The rollback command only partially works.
@BurningDog issue no 5. primary key mentioned in model
@BurningDog issue no 7. you can find doc here https://infyom.com/open-source/laravelgenerator/docs/8.0/generator-options#save-model-schema
@BurningDog Regarding API routes. we update docs soon with v1 here https://infyom.com/open-source/laravelgenerator/docs/8.0/installation#update-api-routes
@BurningDog we will plan a letter
@BurningDog Generator only generates input. you need to implement store and move file logic your end.
@BurningDog Test generate for API. you need to configure php.unit manually
Hi! Firstly, thanks for making an awesome product! I'm finding it quite useful and have recommended it to others.
That said, I found many issues in normal usage when following the installation and usage documentation at https://www.infyom.com/open-source/laravelgenerator/docs/8.0/ which seem to be major bugs. I could list each of these as a new issue on GitHub, but I didn't want to overwhelm the issue queue.
I'm using latest Laravel and latest version of the Infyom Generator. I'm not using the boilerplate, although I've had to refer to it in many cases.
Missing laravelcollective/html
https://www.infyom.com/open-source/laravelgenerator/docs/8.0/installation#add-aliases says to add the following to
config/app.php
:but neglects to mention that there is a package which needs to be installed in order for them to work:
This package is already installed in the
composer.json
in the boilerplateMissing files
A number of base files are missing, perhaps I missed somewhere in the setup documentation where they're generated? These files are all present in the adminlte-generator boilerplate - I had to copy them manually into my project:
App\Http\Controllers\AppBaseController
App\Repositories\BaseRepository
Tests\ApiTestTrait
Handling file uploads
This seems to be left as an exercise to the developer? When I make the
htmlType
for a field to befile
then an HTML file input is used for the generated CRUD controller, but instead of saving the file correctly, it merely leaves it in/private/tmp
as the temporary filename. I was expecting to see it saved as a file within Laravel.Rollback command doesn't roll back all files
The rollback command only partially works.
The generated migration is very basic
The generated migration doesn't specify a primary key (even if
"primary": true,
is set in the field json, and--fieldsFile=
is used as the scaffold). This must be added manually.In addition, there's no ability to set fields as nullable when using a fields file, so this needs to manually done in the migration. It would be useful if the documentation mentioned that.
Incorrect path
https://www.infyom.com/open-source/laravelgenerator/docs/8.0/generator-options#fields-from-file says that the path to the sample json file is
vendor\infyom\laravel-generator\samples\fields_sample.json
which is incorrect, it'svendor/infyomlabs/laravel-generator/samples/fields_sample.json
Undocumented model_schema directory
At https://www.infyom.com/open-source/laravelgenerator/docs/8.0/generator-options#fields-from-file it should be made clear that
resources/model_schemas/
can be used to put generated json files in to use for model generation. I had to read the code to work that out.Generated models
The generated models have extra, unnecessary line breaks in the file which I need to manually remove.
When Swagger comments are added as documentation, they overwrite the comments left which document all of the model's attributes. If I want those comments, I have to run 2 separate Infyom generation commands, copying the attributes after the first one and manually adding them back in after the 2nd.
Other spacing issues
When a controller is generated, the first lines in the class read:
It should be:
or even better,
Indentation in generated factories
The indentation of generated factories is incorrect - the first attribute is correct, all of the following aren't.
Route prefix incorrect
In
api.php
I havebut actually it should be
Tests
Neither generated API tests nor Repository tests work out of the box. Firstly,
phpunit.xml
has to be configured to include them:Then, each test needs to use
DatabaseMigrations
.Generated API urls
Regarding the API url generated - e.g.
/api/v1/blogPosts
- https://blog.restcase.com/5-basic-rest-api-design-guidelines/ notes thatThe url generated should be
/api/v1/blog-posts
v1 isn't in URL
It's not clear that
v1
won't be in the url by looking at the config:In what sense is
v1
a route prefix if it's not used in the actual route?In fact,
route
must be set tov1
inprefixes
like so:It's not clear to me each option does, and the comments don't help explain it either. Please be more descriptive.
Laravel style guide
The generated Blade templates should follow the Laravel style - see https://github.com/laravel/laravel/blob/8.x/resources/views/welcome.blade.php which uses 4 spaces, not 2. Since I have my IDE set up correctly, as soon as I edit one of those files it gets entirely reformatted.
appointer/swaggervel
is abandonedhttps://github.com/appointer/swaggervel is abandoned. The package to use instead is probably https://github.com/DarkaOnLine/L5-Swagger
Overall workflow
It's nearly impossible that a developer knows exactly what all fields will be upfront, and only uses the generation process once. It would be useful to show a non-trivial example where:
--skip=menu
)--skip=migration