Answer the question
In order to leave comments, you need to log in
Why can't laravel create a table?
Terminal gives me this error when I try to create
my migration table:
class CreateBooksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('books', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('description');
$table->string('author');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('books');
}
}
class Book extends Model
{
protected $table = 'books';
protected $fillable = [
'title',
'description',
'author'
];
}
Answer the question
In order to leave comments, you need to log in
Schema::create('books', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('description');
$table->string('author');
$table->timestamps();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question