“Contoh migrasi Laravel” Kode Jawaban

Buat migrasi dengan model laravel

#create model
	php artisan make:model Model_Name

#create model with migration
 	php artisan make:model Model_Name -m

#create model with migration and controller
    php artisan make:model Model_Name -mcr
Engineer Wajid Ali

Migrasi membutuhkan laravel lapangan

$table->string('foo')->nullable(false)->change();
r00ster

Buat migrasi dengan model laravel

php artisan make:model Settings --migration
Calm Crossbill

Contoh migrasi Laravel

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFirstTable extends Migration
{
    public function up()
    {
        Schema::create('first_table', function (Blueprint $table) {
            $table->increments('id');
            $table->string('first_string_column_name');
            $table->integer('secont_integer_column_name');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('first_table');
    }
}
Disgusted Duck

Contoh migrasi Laravel

php artisan make:migration create_first_table --create=first_table
Disgusted Duck

Contoh migrasi Laravel

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFirstTable extends Migration
{
    public function up()
    {
        Schema::create('first_table', function (Blueprint $table) {
            $table->increments('id');
            $table->string('first_string_column_name');
            $table->integer('secont_integer_column_name');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('first_table');
    }
}
Disgusted Duck

Jawaban yang mirip dengan “Contoh migrasi Laravel”

Pertanyaan yang mirip dengan “Contoh migrasi Laravel”

Lebih banyak jawaban terkait untuk “Contoh migrasi Laravel” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya