PHP code example of roger-russel / schemaum

1. Go to this page and download the library: Download roger-russel/schemaum 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/ */

    

roger-russel / schemaum example snippets


/**
 * @param string $databaseLike [ like string on database ]
 * @param string $userLik [ like string on database ]
 * @param function [This function is the very same which is 


use Schemaum\Schemas; // use Schemas instead of Laravel Schema
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterSomeTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //Firts parameter is database like, and the second one is table like
        Schemas::table('database_%','users_%', function(Blueprint $table){
            $table->string('phone');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //Firts parameter is database like, and the second one is table like
        Schemas::table('database_%','users_%',function(Blueprint $table){
            $table->dropColumn('phone');
        });
    }