کد خودتون رو ارسال کنید همراه سوال .
کدی که در قسمت migrate این مدل نوشتید .
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCommentsTable extends Migration
{
/**
@return void
*/
public function up()
{
Schema::create('comments', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('post_id');
$table->string('commenter');
$table-string('email');
$table->text('comment');
$table->boolean('approved');
$table->timestamps();
});
}
/**
شاید پاسخ شما همینجا باشد
اگر لطف کنید کد خودتون رو داخل ``` اینا قرار بدید خیلی خوانا تر میشه ..
الان خیلی بهم ریختس
Sample codeاولین بارمه از این بخش سایت استفاده میکنم چطوری از ''' این ها استفاده کنم
کدهای خودتون رو بین دو تا از اینا ``` قرار بدید .
یعنی اول خط اون سه تا علامت (توجه کنید که سینگل کت نیستن ، اینی که شما گذاشتی خیر ''' ) رو قرار بدید و بعد کدها رو قرار بدید و سپس مجددا بعد از کدهاتون اون علامت رو قرار بدید .
موفق باشید
<?php
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreateCommentsTable extends Migration
{
/**
Run the migrations.
@return void
*/
public function up()
{
Schema::create('comments', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('post_id');
$table->string('commenter');
$table-string('email');
$table->text('comment');
$table->boolean('approved');
$table->timestamps();
});
}
/**
Reverse the migrations.
@return void
*/
public function down()
{
Schema::drop('comments');
}
}دوسه جاشو اشتباه نوشته بودی دوست عزیز:
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreateCommentsTable extends Migration
{
/**
Run the migrations.
@return void
*/
public function up()
{
Schema::create('comments', function (Blueprint $table) {
$table->increments('id');
$table->integer('post_id')->unsigned();
$table->string('commenter');
$table->string('email');
$table->text('comment');
$table->boolean('approved');
$table->timestamps();
});
}
/**
Reverse the migrations.
@return void
*/
public function down()
{
Schema::dropIfExists('comments');
}
}با سلام کافیه در env.
در قسمت
DB_DATABASE رو به phpmyadmin تغییر بدید .