PHP code example of little-superman / laravel-database

1. Go to this page and download the library: Download little-superman/laravel-database library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

little-superman / laravel-database example snippets




use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use LittleSuperman\Database\Facades\SchemaExtends;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        SchemaExtends::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            
            $table->tableComment('表备注');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}
shell
php artisan customize:migration 表名称