PHPackages                             jumilla/laravel-addomnipot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. jumilla/laravel-addomnipot

AbandonedArchivedFramework-extension[Framework](/categories/framework)

jumilla/laravel-addomnipot
==========================

Addon system for Laravel.

2.0.1(8y ago)71.0k[1 issues](https://github.com/jumilla/laravel-addomnipot/issues)2MITPHPPHP ^7.0

Since Dec 27Pushed 8y ago4 watchersCompare

[ Source](https://github.com/jumilla/laravel-addomnipot)[ Packagist](https://packagist.org/packages/jumilla/laravel-addomnipot)[ Docs](http://jumilla.me)[ RSS](/packages/jumilla-laravel-addomnipot/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (10)Versions (36)Used By (2)

Laravel Addomnipot
==================

[](#laravel-addomnipot)

[![Build Status](https://camo.githubusercontent.com/0ab28cf24a20d5e16323f9cc6ee907f8dffc3b63a10484189ac46e0cec850d30/68747470733a2f2f7472617669732d63692e6f72672f6a756d696c6c612f6c61726176656c2d6164646f6d6e69706f742e737667)](https://travis-ci.org/jumilla/laravel-addomnipot)[![Quality Score](https://camo.githubusercontent.com/c5db4eca8d2677a9edd236f1f576180d00b4a92d2b3de0d6bc584fe7dbeac0e5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a756d696c6c612f6c61726176656c2d6164646f6d6e69706f742e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/jumilla/laravel-addomnipot)[![Code Coverage](https://camo.githubusercontent.com/4ff24c8d581c5834bf59e6dd93cb76a91b6cc56f23aa0942a3727d8d970e206b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a756d696c6c612f6c61726176656c2d6164646f6d6e69706f742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jumilla/laravel-addomnipot)[![Latest Stable Version](https://camo.githubusercontent.com/19698442e9ad728b54d75d0e58288cbb3a53fd62a6379031a5d5f5aaa29aa017/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d706c75732f6164646f6d6e69706f742f762f737461626c652e737667)](https://packagist.org/packages/laravel-plus/addomnipot)[![Total Downloads](https://camo.githubusercontent.com/a957b378e84622052d88a7898e79e8e35cf2bab3ea95f8435b187bc907a0d365/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d706c75732f6164646f6d6e69706f742f642f746f74616c2e737667)](https://packagist.org/packages/laravel-plus/addomnipot)[![Software License](https://camo.githubusercontent.com/90fc7138e9923c052b77bdea3e1aa1526a7a57e244f4388a51d7b3eb3d2c11fe/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d706c75732f6164646f6d6e69706f742f6c6963656e73652e737667)](https://packagist.org/packages/laravel-plus/addomnipot)

[日本語ドキュメント - Japanese](readme-ja.md)

Features
--------

[](#features)

- Additional add-on features

    - 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'.
    - 9 types of stationery and offers 2 types of sample. Can be generated by artisan command `php artisan make:addon`.
- Solution of a facade problem in the namespace

    - 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
--------------

[](#how-to-install)

### \[A\] Download the Laravel stationery project

[](#a-download-the-laravel-stationery-project)

Note: Pacakge Discovery supported.

It is a way to use a model project already to incorporate the [Laravel Extension Pack](https://github.com/jumilla/laravel-extension).

In addition to the [Laravel Addomnipot](https://github.com/jumilla/laravel-addomnipot) of add-on features, and to the [Laravel Versionia](https://github.com/jumilla/laravel-versionia) of semantic version-based migration feature, you can also use source code generator corresponding to the add-on.

```
composer create-project laravel-plus/laravel5
```

### \[B\] Install the `laravel-plus/extension` to an existing project.

[](#b-install-the-laravel-plusextension-to-an-existing-project)

Note: Pacakge Discovery supported.

It is a way to use [Laravel Extension Pack](https://github.com/jumilla/laravel-extension).

In addition to the [Laravel Addomnipot](https://github.com/jumilla/laravel-addomnipot) of add-on features, and to the [Laravel Versionia](https://github.com/jumilla/laravel-versionia) of semantic version-based migration feature, you can also use source code generator corresponding to the add-on.

For more information, please refer to the [Laravel Extension Pack](https://github.com/jumilla/laravel-extension) of the document.

### \[C\] Install the `jumilla/laravel-addomnipot` to an existing project.

[](#c-install-the-jumillalaravel-addomnipot-to-an-existing-project)

Note: Pacakge Discovery supported.

It is a way to incorporate the only [Laravel Addomnipot](https://github.com/jumilla/laravel-addomnipot) of add-on features.

#### 1. Add the package `jumilla/laravel-addomnipot` use Composer.

[](#1-add-the-package-jumillalaravel-addomnipot-use-composer)

Use composer.

```
composer require jumilla/laravel-addomnipot
```

#### 2. Add the service provider.

[](#2-add-the-service-provider)

Edit file `config/app.php`.

```
	'providers' => [
		Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
		...
		// Add the folloing line.
		Jumilla\Addomnipot\Laravel\ServiceProvider::class,
	],
```

Check for running
-----------------

[](#check-for-running)

Add-on `wiki` is made as a example.

```
php artisan make:addon wiki sample:ui
```

Please confirm the routing setting.

```
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.

```
php artisan serve
```

Commands
--------

[](#commands)

### `addon:list`

[](#addonlist)

List addons.

```
php artisan addon:list
```

When `addons` directory file don't exist, it's made.

### `addon:status`

[](#addonstatus)

Can check the status of addons.

```
php artisan addon:status
```

When `addons` directory file don't exist, it's made.

### `addon:name`

[](#addonname)

A file in the add-on is scanned and the PHP namespace is changed.

```
php artisan addon:name blog Wonderful/Blog
```

When you'd like to confirm the scanned file, please designate `-v` option.

```
php artisan addon:name blog Wonderful/Blog -v
```

### `addon:remove`

[](#addonremove)

An add-on is eliminated.

```
php artisan addon:remove blog;
```

`addons/blog` A directory is just eliminated.

### `make:addon`

[](#makeaddon)

An add-on is made. I add on the next command `blog` is generated as PHP name spatial `Blog` using a form of `library`-type, `blog-app` is generated as PHP name spatial `BlogApp` using a form of `ui`-type.

```
php artisan make:addon blog library
php artisan make:addon blog-app ui
```

A skeleton can be chosen from 10 kinds.

- **minimum** - Minimum structure.
- **simple** - The simple structure with the directory **views** and the file **Http/route.php**.
- **asset** - Minimum structure.
- **library** - The composition to which a PHP range and a database are offered.
- **api** - The structure for Web API.
- **ui** - The structure for Web UI.
- **ui-sample** - Example of a Web 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.
- **laravel5-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.

```
php artisan make:addon blog
```

PHP namespace can designate `--namespace` by an option. Please use `\\` or `/` for a namespace separate.

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

Helper functions
----------------

[](#helper-functions)

### addon($name = null)

[](#addonname--null)

Get the add-on by name.

```
$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())`.

```
namespace Blog\Http\Controllers;

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

`LaravelPlus\Extension\Addons\Addon` object retrieved by the `addon()` function, you can access the add-on attributes and resources.

```
$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)

[](#addon_nameclass)

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.

```
$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.

```
