ed-fruty/laravel4-namespace-migrator

Package for Laravel 4, supporting using namespaces in migration classes
26 2
Install
composer require ed-fruty/laravel4-namespace-migrator
Latest Version:v1.0.0
License:MIT
Last Updated:Dec 3, 2014
Links: GitHub  ·  Packagist
Maintainer: ed-fruty

laravel4-namespace-migrator

Laravel 4 is not support namespaces in migration classes, but it is not a problem ;)

#Installation

  1. Use Composer to install package into your project:
composer require "ed-fruty/laravel4-namespace-migrator": "1.0.0"
  1. Add the service provider in app/config/app.php:
'Fruty\LaravelNamespaceMigrator\LaravelNamespaceMigratorServiceProvider',
  1. Publish package configuration
php artisan config:publish ed-fruty/laravel4-namespace-migrator

#Usage

'reserved' => [
      base_path('app/modules/Blog/migrations') => 'Blog\\Migrations\\',
  ]

It means, when you call migrations like:

php artisan migrate --path=app/modules/Blog/migrations

Migrator automatically searches classes with namespace Blog\Migrations in that directory.

php artisan migrate --bench=foo/bar

Migrator searches classes with namespace Foo\Bar\Migrations in workbench/foo/bar/src/migrations So if workbench namespace does not equal to vendor/package name you must register it in 'reserved' block like:

base_path('workbench/foo/bar/src/migrations') => 'VendorNamespace\\PackageNamespace\\'
php artisan migrate

By default configs, Migrator firstly searches migration classes with namespace App\database\migrations in app/database/migrations and if it does not exists, Migrator tries to load class without namespace from that catalog.

Related Packages

awssat/laravel-sync-migration

Developer tool helps to sync migrations without refreshing the database

23,551 108
simlux/laravel-migration-helper

Helper functions for laravel migrations.

140 0
php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the...

53,306 162
artdarek/oauth-4-laravel

OAuth Service Provider for Laravel 4

518,442 678