Question

I come from CakePHP, recently started learning Laravel-4. It is very hard to see that such a great framework does not come with a code generator for basic CRUD operations. Is that a conscious decision or am I missing something ?

Was it helpful?

Solution

Pretty certain it was a conscious decision. However, Jeffrey Way has created a killer Generator package for Laravel:

https://github.com/JeffreyWay/Laravel-4-Generators

OTHER TIPS

Laravel 5.1 comes with artisan make command to generate different code files, following is a list:

Available commands for the "make" namespace:
  make:command     Create a new command class
  make:console     Create a new Artisan command
  make:controller  Create a new resource controller class
  make:event       Create a new event class
  make:job         Create a new job class
  make:listener    Create a new event listener class
  make:middleware  Create a new middleware class
  make:migration   Create a new migration file
  make:model       Create a new Eloquent model class
  make:policy      Create a new policy class
  make:provider    Create a new service provider class
  make:request     Create a new form request class
  make:seeder      Create a new seeder class
  make:test        Create a new test class

This is a great package. Very flixable and generate complete and clean code.

https://packagist.org/packages/crestapps/laravel-code-generator

It has full documentation at http://crestapps.com/laravel-code-generator/docs/2.2

Here are YouTube screencasts to get you started https://www.youtube.com/channel/UCkEd0nOoRf3o0ahspAu7Y9w/videos

Here is one another package that I have created and which generates a API/CRUD via one single command.

https://github.com/mitulgolakiya/laravel-api-generator

I think you could try Vemto which is a Laravel Studio and Code Generator with a GUI

You can try using the Vemto to generate all your APIs/CRUDs.

It is a very flexible generator that generates clean and easy-to-read codes.

I also did a code generator that will read database table structure and create Laravel Models, Request, Controller and other assets according to that.

https://github.com/digitaldreams/laracrud

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top