2017 © Pedro Peláez
 

framework-extension extension

Laravel Extension Pack

image

laravel-plus/extension

Laravel Extension Pack

  • Tuesday, September 19, 2017
  • by jumilla
  • Repository
  • 6 Watchers
  • 34 Stars
  • 1,604 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 50 Versions
  • 1 % Grown

The README.md

Laravel Extension Pack

Build Status Quality Score Code Coverage Latest Stable Version Total Downloads Software License, (*1)

日本語ドキュメント - Japanese, (*2)

Features

  • Additional version-based migration features, (*3)

    • It adopted a semantic version based database migration library. Laravel Versionia has been included.
    • Migration & seed class, have been incorporated into the directory structure of Laravel 5.
    • You can now specify a group to migration.
    • Now the name is attached to the seed.
    • Designation of the version, in the class App/Providers/DatabaseServiceProvider.
    • You can use as is the migration & seed class of Laravel.
  • Additional add-on features, (*4)

    • It is a package feature in the application. You can use the image to replicate the directory structure of Laravel 5.
    • By default, it will be placed under the 'addons' directory.
    • You can make one have its own name space (PSR-4) to add-on.
    • It can serve as a package of Laravel 5. Valid namespace notation {addon-name}:: can be used 'lang', 'view'. Also can use 'config'.
    • Only additional add-on to copy the directory. You do not need to add code to the configuration file, such as 'config/app.php'.
    • 7 types of stationery and offers two types of sample. Can be generated by artisan command php artisan make:addon.
  • Commands of file generation, (*5)

    • The class of Laravel 5 that can be generated from the command line, such as Console command, Job, Provider, ...
    • The generator command can also be used a customized stub file.
    • Compliance with Laravel 5 command of make:xxx. Command names and options are the same.
    • In --addon option, you can also generate a file in the add-on.
  • Solution of a facade problem in the namespace, (*6)

    • A facade can be used in the class with a name space under the app directory. (A backslash and a use declaration, unnecessary)
    • A facade can also be handled by the same description method from the inside in add-on name space.

How to install

[A] The Laravel project which is already included is downloaded.

composer create-project laravel-plus/laravel5 <project-name>

[B] It's installed in a project of existence.

1. Add the package laravel-plus/extension use Composer.

Use composer., (*7)

composer require laravel-plus/extension

2. Add/Remove the service provider.

Edit file config/app.php. - Add LaravelPlus\Extension\ServiceProvider::class in providers section. - Remove line includes Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class in providers section., (*8)

    'providers' => [
        Illuminate\View\ViewServiceProvider:class,
        ...
        // Add the folloing line.
        LaravelPlus\Extension\ServiceProvider::class,
    ],
    'providers' => [
        // Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    ],

Check for running

Add-on wiki is made as a example., (*9)

php artisan make:addon wiki sample:ui

Please confirm the routing setting., (*10)

php artisan route:list

A local server is started and accesses http://localhost:8000/addons/wiki by a browser. When a package name is indicated, it's success., (*11)

php artisan serve

Commands

database:status

Migration, seed's definition and installation state are indicated., (*12)

php artisan database:status

database:upgrade

up() method in migration of all groups, it's carried out and it's made a newest version., (*13)

php artisan database:upgrade

It's possible to make them seed after my gray-tion., (*14)

php artisan database:upgrade --seed <seed>

database:clean

down() method in migration of all groups, , it's carried out and it's returned in the clean state., (*15)

php artisan database:clean

database:refresh

Re-run migration of all groups., (*16)

After database:clean and database:upgrade were carried out, same., (*17)

php artisan database:refresh

It's possible to make them seed after migration., (*18)

php artisan database:refresh --seed <seed>

database:rollback

The version of the specified group is returned one., (*19)

php artisan database:rollback <group>

When --all option is put, everything's version of the designation group is eliminated., (*20)

php artisan database:rollback <group> --all

database:again

A newest version of a specified group is made., (*21)

I have the same effect as the time when database:rollback <group> and database:upgrade were carried out., (*22)

php artisan database:again <group>

It's possible to make them seed after migration., (*23)

php artisan database:again <group> --seed <seed>

database:seed

Run specified seed., (*24)

php artisan database:seed <seed>

When omitting <seed>, run default seed., (*25)

php artisan database:seed

addon:status

Can check the status of addons., (*26)

php artisan addon:status

When addons directory and config/addon.php file don't exist, it's made., (*27)

addon:name

A file in the add-on is scanned and the PHP namespace is changed., (*28)

php artisan addon:name blog Wonderful/Blog

When you'd like to confirm the scanned file, please designate -v option., (*29)

php artisan addon:name blog Sugoi/Blog -v

addon:remove

An add-on is eliminated., (*30)

php artisan addon:remove blog;

addons/blog A directory is just eliminated., (*31)

make:addon

An add-on is made. I add on the next command blog is generated as PHP name spatial Blog using a form of ui-type., (*32)

php artisan make:addon blog ui

A skeleton can be chosen from 9 kinds., (*33)

  • minimum - Minimum structure.
  • simple - The simple structure with the directory views and the file route.php.
  • library - The composition to which a PHP range and a database are offered.
  • api - The structure for API.
  • ui - Full-set including UI.
  • debug - The add-on in which program testing facility is put. Service provider registration of 'debug-bar' is also included.
  • generator - Customized for stub files.
  • laravel5 - The directory structure of Laravel 5.
  • sample:ui - Example of a UI add-on.
  • sample:auth - The authentication sample included in Laravel 5.

When not designating a form by a command argument, it can be chosen by an interactive mode., (*34)

php artisan make:addon blog

PHP namespace can designate --namespace by an option. Please use \\ or / for a namespace separate., (*35)

php artisan make:addon blog --namespace App\\Blog
php artisan make:addon blog --namespace App/Blog

make:console

Generate a class of artisan command., (*36)

If you specify foo to name, to generate a file app/Console/Commands/Foo.php., (*37)

$ php artisan make:console foo

If you specify blog to option --addon, to generate a file addons/blog/classes/Commands/Foo.php., (*38)

$ php artisan make:console foo --addon=blog

make:controller

Generate a class of controller., (*39)

If you specify FooController to name, to generate a file app/Http/Controllers/FooController.php., (*40)

$ php artisan make:controller FooController

If you specify option --resource, to generate a resource controller., (*41)

$ php artisan make:controller FooController --resource

If you specify blog to option --addon, to generate a file addons/blog/classes/Controllers/FooController.php., (*42)

$ php artisan make:controller FooController --addon=blog

make:event

Generate a class of event., (*43)

If you specify FooEvent to name, to generate a file app/Events/FooEvent.php., (*44)

$ php artisan make:event FooEvent

If you specify blog to option --addon, to generate a file addons/blog/classes/Events/FooEvent.php., (*45)

$ php artisan make:event FooEvent --addon=blog

make:job

Generate a class of job., (*46)

If you specify a FooJob to name, to generate a file app/Jobs/FooEvent.php., (*47)

$ php artisan make:job FooJob

If you specify option --queued, to generate a job class implemented ShouldQueue interface., (*48)

$ php artisan make:job FooJob --queued

If you specify blog to option --addon, to generate a file addons/blog/classes/Jobs/FooJob.php., (*49)

$ php artisan make:job FooJob --addon=blog

If using a App/Commands directory of Laravel 5.0, app/Commands/FooCommand.php can also be generated., (*50)

$ php artisan make:job /Commands/FooCommand

make:listener

Generate a class of listener., (*51)

If you specify FooListener to name, to generate a file app/Listeners/FooListener.php. Require --event option., (*52)

$ php artisan make:listener FooListener --event=bar

If you specify option --queued, to generate a job class implemented ShouldQueue interface., (*53)

$ php artisan make:listener FooListener --event=bar --queued

If you specify blog to option --addon, to generate a file addons/blog/classes/Listeners/FooListener.php., (*54)

$ php artisan make:listener FooListener --event=bar --addon=blog

make:middleware

Generate a class of middleware., (*55)

If you specify foo to name, to generate a file app/Http/Middleware/Foo.php., (*56)

$ php artisan make:middleware foo

If you specify blog to option --addon, to generate a file addons/blog/classes/Middleware/Foo.php., (*57)

$ php artisan make:middleware foo --addon=blog

make:migration

Generate a class of migration., (*58)

If you specify foo to name, to generate a file app/Database/Migrations/App_1_0.php., (*59)

$ php artisan make:migration App_1_0

If you specify materials to option --create, to generate a migration class for create materials table., (*60)

$ php artisan make:migration App_1_1 --create=materials

If you specify materials to option --update, to generate a migration class for update materials table., (*61)

$ php artisan make:migration App_1_2 --update=materials

If you specify blog to option --addon, to generate a file addons/blog/classes/Migrations/Blog_1_0.php., (*62)

$ php artisan make:migration Blog_1_0 --addon=blog

make:model

Generate a class of Eloquent model., (*63)

If you specify foo to name, to generate a file app/Foo.php related to foos table., (*64)

$ php artisan make:model foo

If you specify services/models/foo to name, to generate a file app/Services/Models/Foo.php related to foos table. PHP namespace will be App\Services\Models., (*65)

$ php artisan make:model services/models/foo

If you specify App_1_1 to option --migration, also generates together migration file. This is the same as a result of executing the command php artisan make:migration App_1_1 --create=foos., (*66)

$ php artisan make:model foo --migration=App_1_1

If you specify blog to option --addon, to generate a file addons/blog/classes/Foo.php., (*67)

$ php artisan make:model foo --addon=blog

make:policy

Generate a class of policy., (*68)

If you specify foo to name, to generate a file app/Policies/Foo.php., (*69)

$ php artisan make:policy foo

If you specify blog to option --addon, to generate a file addons/blog/classes/Policies/Foo.php., (*70)

$ php artisan make:policy foo --addon=blog

make:provider

Generate a class of service provider., (*71)

If you specify FooServiceProvider to name, to generate a file app/Providers/FooServiceProvider.php., (*72)

$ php artisan make:provider FooServiceProvider

If you specify blog to option --addon, to generate a file addons/blog/classes/Providers/FooServiceProvider.php., (*73)

$ php artisan make:provider FooServiceProvider --addon=blog

make:request

Generate a class of form request., (*74)

If you specify FooRequest to name, to generate a file app/Http/Requests/FooRequest.php., (*75)

$ php artisan make:request FooRequest

If you specify blog to option --addon, to generate a file addons/blog/classes/Requests/FooRequest.php., (*76)

$ php artisan make:request FooRequest --addon=blog

make:seeder

Generate a class of seeder., (*77)

If you specify staging to name, to generate a file app/Database/Seeds/Staging.php., (*78)

$ php artisan make:request staging

If you specify blog to option --addon, to generate a file addons/blog/classes/Seeds/Staging.php., (*79)

$ php artisan make:request staging --addon=blog

make:test

Generate a class of PHPUnit test suite., (*80)

If you specify FooTests to name, to generate a file tests/FooTests.php., (*81)

$ php artisan make:test FooTests

If you specify blog to option --addon, to generate a file addons/blog/tests/FooTests.php., (*82)

$ php artisan make:test FooTests --addon=blog

Helper functions

addon($name = null)

Get the add-on by name., (*83)

$addon = addon('blog');

If omit the name, it returns the add-on that contains the calling class. This is equivalent to a addon(addon_name())., (*84)


namespace Blog\Http\Controllers; class BlogController { public function index() { $addon = addon(); // == addon(addon_name()) Assert::same('blog', $addon->name()); } }

object retrieved by the addon() function, you can access the add-on attributes and resources., (*85)

$addon = addon();
$addon->path();             // {$root}/addons/blog
$addon->relativePath();     // addons/blog
$addon->phpNamespace();     // Blog
$addon->config('page.row_limit', 20);
$addon->trans('emails.title');
$addon->transChoice('emails.title', 2);
$addon->view('layouts.default');
$addon->spec('forms.user_register');

addon_name($class)

Get the add-on name from the class name . The class name must be a fully qualified name that contains the name space. Get the add-on by name., (*86)

$name = addon_name(get_class($this));
$name = addon_name(\Blog\Providers\AddonServiceProvider::class);        // 'blog'

If you omit the argument, returns the name of the add-on contains the caller of the class., (*87)

<?php

namespace Blog\Controllers;

class PostsController
{
    public function index()
    {
        $name = addon_name();       // 'blog'
    }
}

Facade expansion

Facade of Laravel converts the static method call of class to an instance method invocation, and has been achieved by creating an alias for the facade class in the global namespace. For Laravel 5 alias loader does not act only in the global name space , to handle the facade from the name space (such as App) it must put \ to the class name prefix., (*88)

function index()
{
    return \View::make()
}

Or a use declaration is used., (*89)

use View;

...

function index()
{
    return View::make()
}

Laravel Extension has the alias loader which settles a facade in the namespace in the add-on bottom, so a way of Laravel 4.2 formula document mentioning can be used just as it is., (*90)

function index()
{
    return View::make()
}

Bootstrap behavior

  • Require files entry in file addons/{addon-name}/addon.json.
  • Sees namespace entry in file addons/{addon-name}/addon.php and establishes class automatic threading based on PSR-4 agreement to all directories specified as directories.

Author

古川 文生 / Fumio Furukawa (fumio@jumilla.me), (*91)

License

MIT, (*92)

The Versions

19/09 2017

dev-master

9999999-dev https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

19/09 2017

dev-develop

dev-develop https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

19/09 2017

4.0.3

4.0.3.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

19/09 2017

4.0.2

4.0.2.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

19/09 2017

4.0.1

4.0.1.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

19/09 2017

4.0.0

4.0.0.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

29/01 2017

3.8.2

3.8.2.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

28/01 2017

3.7.1

3.7.1.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

28/01 2017

3.8.1

3.8.1.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

27/01 2017

3.8.0

3.8.0.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

14/01 2017

3.7.0

3.7.0.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

14/01 2017

3.6.2

3.6.2.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

12/01 2017

3.6.1

3.6.1.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

12/01 2017

3.6.0

3.6.0.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

06/12 2016

v3.5.4

3.5.4.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

03/09 2016

v3.5.3

3.5.3.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

26/08 2016

v3.5.2

3.5.2.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

26/08 2016

v3.5.1

3.5.1.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

26/08 2016

v3.5.0

3.5.0.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

04/08 2016

v3.4.1

3.4.1.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

03/08 2016

v3.4.0

3.4.0.0 https://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

14/01 2016

v3.3.0

3.3.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

05/01 2016

v3.2.0

3.2.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

02/01 2016

v3.1.0

3.1.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

27/12 2015

v3.0.0

3.0.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

11/11 2015

v2.5.1

2.5.1.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

18/10 2015

v2.5.0

2.5.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

17/10 2015

v2.4.3

2.4.3.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

15/10 2015

v2.4.2

2.4.2.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

09/10 2015

v2.4.1

2.4.1.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

08/10 2015

v2.4.0

2.4.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

18/07 2015

v2.1

2.1.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel migration laravel 5 facade addon architecture

23/03 2015

dev-laravel4

dev-laravel4 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel laravel4 facade addon architecture

23/03 2015

v1.3.2

1.3.2.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel laravel4 facade addon architecture

15/03 2015

v1.3.1

1.3.1.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel laravel4 facade addon architecture

11/03 2015

v1.3.0

1.3.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel laravel4 facade addon architecture

08/03 2015

v2.0

2.0.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel laravel4 facade addon architecture

19/11 2014

v1.2

1.2.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel laravel4 facade addon architecture

23/09 2014

v1.1

1.1.0.0 http://laravel.tokyo

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

laravel laravel4 facade addon architecture

12/06 2014

v1.0

1.0.0.0 http://io.laravel.jp

Laravel Extension Pack

  Sources   Download

MIT

The Requires

 

by Fumio Furukawa

plugin laravel laravel4 facade architecture