PHP code example of hamzaouaghad / multilayering
1. Go to this page and download the library: Download hamzaouaghad/multilayering library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hamzaouaghad / multilayering example snippets
App\Providers\MultilayerGeneratorServiceProvider`.
$ php artisan vendor:publish
class User extends Eloquent
interface SecurityInterface
class AccountsRepository implements SecurityInterface
class STAFFmotor extends Motor
{
public function __construct(AccountsRepository $repo)
{
$this->repository = $repo;
}
use /Authentication;
}
class MultilayerGeneratorServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->booting(function(){
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
/*
|
| Repositories Classes
|
*/
$loader->alias('AccountsRepository', 'App\DataLayer\Repositories\AccountsRepository');
$loader->alias('AccountsRepoInterface', 'AccountsRepository');
/*
|
| Object Classes
|
*/
$loader->alias('User', 'App\DataLayer\Objects\User');
/*
|
| Traits
|
*/
$loader->alias('CRUDtrait', 'App\Http\Traits\CRUDtrait');//don't modify this.
$loader->alias('AuthenticationTrait', 'App\Http\Traits\AuthenticationTrait');
/*
|
| Motors
|
*/
$loader->alias('Motor', 'App\Http\Motors\Motor');
$loader->alias('STAFFmotor', 'App\Http\Controllers\Motors\STAFFmotor');
});
}
}
php
'providers' => [
Hamzaouaghad\Multilayering\MultilayerGeneratorServiceProvider::class,
Hamzaouaghad\Multilayering\RegisterCommandsServiceProvider::class,
],
bash
php artisan make:multilayer