Laralib\L5scaffold\Migrations\SyntaxBuilder::createSchemaForUpMethod PHP Метод

createSchemaForUpMethod() приватный Метод

Create the schema for the "up" method.
private createSchemaForUpMethod ( string $schema, array $meta ) : string
$schema string
$meta array
Результат string
    private function createSchemaForUpMethod($schema, $meta)
    {
        //dd($schema);
        $fields = $this->constructSchema($schema);
        if ($meta['action'] == 'create') {
            return $this->insert($fields)->into($this->getCreateSchemaWrapper());
        }
        if ($meta['action'] == 'add') {
            return $this->insert($fields)->into($this->getChangeSchemaWrapper());
        }
        if ($meta['action'] == 'remove') {
            $fields = $this->constructSchema($schema, 'Drop');
            return $this->insert($fields)->into($this->getChangeSchemaWrapper());
        }
        // Otherwise, we have no idea how to proceed.
        throw new GeneratorException();
    }