Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sohelamin's avatar

Laravel5 CRUD Generator

Hello listener,

I've just developed a CRUD generator for laravel5 though there are so many generators but it's fully a CRUD generator which is allow you to create crud/resourceful things including controller, model, migration, views with a very simple single line command. php artisan crud:generate crud-name --fields="name:string, email:string, phone:integer, message:text"

Here the sources and you will find details instruction through it. https://packagist.org/packages/appzcoder/crud-generator (package) https://github.com/appzcoder/crud-generator (instructions and sources)

Have a great day :)

Thanks

Sohel Amin

0 likes
31 replies
Mythos33's avatar

Hi, I'm using your package and it seems nice. Just some things to improve (just my opinion):

  • Models always get pluralized (User -> Users), would be nice if there's an option to disable that
  • I would like to have editable stubs e.g. the Controllers, Views, etc.

Regards, Stefan

sohelamin's avatar

Hi @Mythos33 thanks for sharing your thought.

Okay I will make an options for artisan command. Also I've made the package Laravel 5.1 compatible.

Thanks, Sohel Amin

glenlockhart's avatar

Thanks for that. So much better than others I have seen. Only extra I would say was it didn't add a route.

The App\http\routes.php could do with something like: Route::resource('ewok','EwokController');

Assuming you like Ewoks!

sohelamin's avatar

Thanks @glenlockhart

I'm very glad that you liked it. Actually the route stuff had to leave for users. User will decide whatever they like. Let me know if you having any other issue.

Thanks Sohel Amin

sakarya's avatar

Hello..

When I want to use the generator taking an error message.

c:\xampp\htdocs\laravel>php artisan crud:generate Makine --fields="name:string, about:text"

Controller created successfully. Model created successfully. Migration created successfully. View created successfully.

[Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected '-', expecting '{'

sohelamin's avatar

Hello @sakara,

Have you tried with laravel 5.1+ with followed full instructions? You can check again with clearly following the instruction again I've just released a stable version. Also let me know if you still getting any errors with full screenshot.

Thanks

riat.a's avatar

Hi,

This is great crud and easy to use, but how to add a field with enum in command. I have this field to do:

php artisan crud:generate EventReg--fields="organizer=string, title:string, eventdate:date, eventtime:time, e_location:string, e_coordinator:string, e_people:string, e_media:string, e_describe:text, e_agenda:enum"

How to write this one?

sohelamin's avatar

Thanks @riat.a for your appreciation on this.

Actually I didn't included enum type field yet. Will add it on the next release.

valdirsjr's avatar

Dear Sohel,

Great job man! I just use your generator and works perfectly well. Thanks a lot.

1 like
mntechsolutions's avatar

HI,

I need some information, your crud generator is really awesome, well let me know i don't want to generate the migration file, i need only controller, model and views only, also route. but when i generate crud through your command, then in model my table name is automatically called with factories, instead of factory. so that is issue number 1.

2nd most important thing is when you write only (php artisan crud:generate TableName) and press enter it only create model/controller and route. why not create view, it should create view based on table columns, if table columns is already exist. so this is my suggestion please add this feature.

3rd thing after giving complete columns through command then your view only create four table heading in listing view plus migration which i don't need if i have already migration class exist.

4th thing what about foreign keys if we want dropdown as select tag then in your view you need to pull data from database table and display as option in select tag, for example: I have country field like pakistan, bangladesh, and their values are 1, 2 so i need them while create.

Hope you understand.

Please let me know.

Best Regards Muhammad Adil

1 like
Ncls's avatar

Amazing plugin! I'm rewriting to use without the Lavel HTML & FORM helpers. Thank you

acellini's avatar

hello, i did all the installation steps on laravel 5.2 . When i try to vendor:publish its said that there is nothing to publish, and then i dont have the crud commnads for execute. There is a change i need to do for 5.2?

thks!

luisy's avatar

Can some body tell me if I can install this package without composer in may pc

Next

Please or to participate in this conversation.