Support the ongoing development of Laravel.io →
Views Blade Packages
Last updated 2 years ago.
0

Do you have a space after the comma's in your artisan command?

Last updated 2 years ago.
0

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'); } }
Last updated 2 years ago.
0

Try removing the underscore in the nerd_level.

Last updated 2 years ago.
0

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();
	});
}
Last updated 2 years ago.
0

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..

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

hzuluaga hzuluaga Joined 22 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.