Do you have a space after the comma's in your artisan command?
I removed the space between ", email" , so the command now is : php artisan generate:scaffold nerds --fields="name:string,email:string,nerd_level:integer"
but still get the same error:
PHP Parse error: syntax error, unexpected ',' in /Library/WebServer/Documents/interlogementlaravel/app/database/migrations/2014_05_23_042630_create_nerds_table.php on line 17 PHP Stack trace:
and the generated migration file is:
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; class CreateNerdsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('nerds', function(Blueprint $table) { $table->increments('id'); $table->string,email('name')->string,nerd_level()->integer(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('nerds'); } }Try removing the underscore in the nerd_level.
I followed what you suggested but there is still something wrong with the generator, it does not build it correctly , there are syntax errors, " $table->string,email('name')->string,level()->integer(); " .THX
the command is : php artisan generate:scaffold nerds --fields="name:string,email:string,level:integer"
the generated file is :
class CreateNerdsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('nerds', function(Blueprint $table) {
$table->increments('id');
$table->string,email('name')->string,level()->integer();
$table->timestamps();
});
}
How did you add the Way/Generators to your configuration and services providers?
Try updating the Way Generators service provider and run the command to update the dependencies of your project.
I would rollback your migrations and re-run as soon you update your dependencies.
Sometimes you need to update your dependencies and re-map it for quit these errors.
Hope it helps you..
Thanks for taking the time to read and answer these questions, I am new to laravel , although I feel I have learn a lot. I built this website with Laravel, my first Laravel project!! still a few things to implement . www.zoluzoft.com/interlogement/public
I 'll try to update the Way/Generators and / or reinstall everything again . I have a larger project and the generators will definitely save me a lot of time for all table that require the CRUD scheme.
I'll let u know.
rgds
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community