Laravel-4-Generators
Laravel-4-Generators copied to clipboard
DB Migration not generated correctly.
The following code is generated on the latest code of generators - i.e: "way/generators": "*" in my composer.json.
php artisan generate:scaffold --fields="sermon_id:integer,author_id:integer,album_id:integer,scheduleddate:date,description:string[80]" sermonmediae
As you can see the up() function really is not correct table generation script. I tried to fix this for last few tables but am tired of manually fixing this.
What causes this? How to fix this?
increments('id'); $table->integer,author_id('sermon_id')->integer,album_id()->integer,scheduleddate()->date,description()->string[80](); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('sermonmediaes'); } ``` }
Try adding a space after the comma, like this :
artisan generate:scaffold create_sermon_mediaes_table --fields="sermon_id:integer, author_id:integer, album_id:integer, scheduleddate:date, description:string[80]"
Daniel - Correct, it will not work as it's generated. My question is, why it's generated this way? The answer is what Jeffery suggested.
Jeffery, Thanks a million! I still don't know why that formgeneration was removed and replaced by simple one liner like "views/create_sermon_mediaes_tables/create.blade.php" , but there has to be a good reason, just I dont get it for now.
In fact, I'm still a beginner and the only thing that helped me choose laravel over other was laravel-4-generators, which was building form upon scaffolding.
Thanks again, -dp
On Thu, May 15, 2014 at 2:35 AM, Valentin PRUGNAUD <[email protected]
wrote:
Try adding a space after the comma, like this :
artisan generate:migration create_sermon_mediaes_table --fields="sermon_id:integer, author_id:integer, album_id:integer, scheduleddate:date, description:string[80]"
— Reply to this email directly or view it on GitHubhttps://github.com/JeffreyWay/Laravel-4-Generators/issues/326#issuecomment-43173619 .
Yes.... Jeffery, Laravel4 Generator with scaffolding is one of the reason I started struggling with Laravel over other framework.. namely Codeignitor. I wish it will come back same as before.
Thanks Jeff, I am learning slowly with laracast.
Zaheen