2017 © Pedro Peláez
 

library laravel-nomad

Add extra functionality to Laravel migrations.

image

shiftonelabs/laravel-nomad

Add extra functionality to Laravel migrations.

  • Friday, February 24, 2017
  • by patrickcarlohickman
  • Repository
  • 2 Watchers
  • 13 Stars
  • 9,798 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 6 Versions
  • 10 % Grown

The README.md

laravel-nomad

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

This Laravel/Lumen package provides additional functionality for the Illuminate Database migrations. Currently the only additional functionality is the ability to specify custom database field types, but new functionality can be added as requested/submitted., (*2)

Supported Versions

4.1, 4.2, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6.x, (*3)

This package has been tested on Laravel 4.1 through Laravel 6.x, though it may continue to work on later versions as they are released. This section will be updated to reflect the versions on which the package has actually been tested., (*4)

Install

Via Composer, (*5)

``` bash $ composer require shiftonelabs/laravel-nomad, (*6)


Once composer has been updated and the package has been installed, the service provider will need to be loaded. #### Laravel 5.5+, 6.x (5.5, 5.6, 5.7, 5.8, 6.x) This package uses auto package discovery. The service provider will automatically be registered. #### Laravel 5.0 - 5.4 (5.0, 5.1, 5.2, 5.3, 5.4) For Laravel 5.0 - 5.4, open `config/app.php` and add the following line to the providers array: ``` php ShiftOneLabs\LaravelNomad\LaravelNomadServiceProvider::class,

Laravel 4 (4.1, 4.2)

For Laravel 4, open app/config/app.php and add the following line to the providers array:, (*7)

``` php 'ShiftOneLabs\LaravelNomad\LaravelNomadServiceProvider',, (*8)


#### Lumen 5.0+, 6.x (5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6.x) For Lumen 5.0+, 6.x, open `bootstrap/app.php` and add the following line under the "Register Service Providers" section: ``` php $app->register(ShiftOneLabs\LaravelNomad\LaravelNomadServiceProvider::class);

Usage

Custom Field Types

Laravel's migrations provide methods for a wide base of the standard field types used in the supported databases, however it is not an exhaustive list. Additionally, some databases have extensions that can be enabled that add new field types. Unfortunately, one cannot create fields with these new data types using built-in migration methods., (*9)

As an example, PostgreSQL has a "citext" module to allow easy case-insensitive matching. This module adds a new "citext" field data type for storing case-insensitive string data. The built-in migration methods do not have a way to create a "citext" field, so one would have to add a direct "ALTER" statement to run after the table is created., (*10)

This package adds a new passthru method to allow defining custom data types in the migration. The passthru method can be used to add a field with any data type, as the specified type is merely passed through to the schema grammar., (*11)

The passthru method requires two parameters: the data type and the field name. An optional third parameter can be used to specify the actual data type definition, if needed. The definition method can also be chained on to specify the actual data type definition. A usage example is shown below:, (*12)

``` php class CreateUsersTable extends Migration { public function up() { Schema::create('users', function(Blueprint $table) { $table->increments('id'); $table->passthru('citext', 'name'); $table->passthru('citext', 'title')->nullable(); $table->passthru('string', 'email', 'varchar(255)')->unique(); $table->passthru('string', 'password')->definition('varchar(60)'); $table->rememberToken(); $table->timestamps(); }); }, (*13)

public function down()
{
    Schema::drop('users');
}

} ```, (*14)

Changelog

This package maintains a changelog. Please see CHANGELOG for details., (*15)

Contributing

Contributions are very welcome. Please see CONTRIBUTING for details., (*16)

Security

If you discover any security related issues, please email patrick@shiftonelabs.com instead of using the issue tracker., (*17)

Credits

License

The MIT License (MIT). Please see License File for more information., (*18)

The Versions

24/02 2017

dev-laravel4-test

dev-laravel4-test https://github.com/shiftonelabs/laravel-nomad

Add extra functionality to Laravel migrations.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Carlo-Hickman

laravel lumen migration custom

24/02 2017

dev-lumen-test

dev-lumen-test https://github.com/shiftonelabs/laravel-nomad

Add extra functionality to Laravel migrations.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Carlo-Hickman

laravel lumen migration custom

23/02 2017

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/shiftonelabs/laravel-nomad

Add extra functionality to Laravel migrations.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Carlo-Hickman

laravel lumen migration custom

23/02 2017

dev-master

9999999-dev https://github.com/shiftonelabs/laravel-nomad

Add extra functionality to Laravel migrations.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Carlo-Hickman

laravel lumen migration custom

23/02 2017

1.0.1

1.0.1.0 https://github.com/shiftonelabs/laravel-nomad

Add extra functionality to Laravel migrations.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Carlo-Hickman

laravel lumen migration custom

15/01 2016

1.0.0

1.0.0.0 https://github.com/shiftonelabs/laravel-nomad

Add extra functionality to Laravel migrations.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Patrick Carlo-Hickman

laravel lumen migration custom