class CreateContactsTable extends Migration {
public function up() {
Schema::create('contacts', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('email');
$table->string('contact_number');
$table->string('address');
$table->timestamps();
});
}
public function down() {
Schema::dropIfExists('contacts');
}
}
Bu yerda biz MB uchun kerakli maydonlarni yaratib oldik.
Factory
Bizda ba'zi ma'lumotlarga ega bo'lish uchun jadvallar mavjud. Laravelda biz factory larni dastlabki foydalanish jarayoni uchun ideal bo'lgan soxta ma'lumotlarni yaratish uchun foydalanishimiz mumkin.
Ushbu app\database\factories\ContactFactory.php faylini ochib quyidagilarni qiling;
/* @var $factory \Illuminate\Database\Eloquent\Factory */