I am attempting to run a migration but the following error is showing up:
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to a member function increments() on a non-object","file":"/Applications/MAMP/htdocs/khadamat/app/database/migrations/2014_03_17_165445_create-users-table.php","line":16}}{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to a member function increments() on a non-object","file":"/Applications/MAMP/htdocs/khadamat/app/database/migrations/2014_03_17_165445_create-users-table.php","line":16}}
This is the code including line 16:
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$table->increments('id');
$table->string('firstname', 40);
$table->string('lastname', 40);
$table->string('dob', 40);
$table->string('email', 150)->unique();
$table->string('password', 64);
$table->string('address', 200);
$table->string('city', 40);
$table->string('country', 100);
$table->string('register_purpose', 40);
$table->timestamps();
}
any clear reason as to why this is happening? Thanks in advance
Schema::create()
/Schema::table()
and do your work inside the closure you pass in. - alexrussell