Download the PHP package si-dev/laravel-layered without Composer

On this page you can find all versions of the php package si-dev/laravel-layered. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-layered

Package for using layered structure in Laravel.

StyleCI License: MIT

This is an open source Laravel package which is intended primarily for those developers who uses the layered structure, like:

model - repository - service - controller

or

model - service - controller.

Actually, the package allows to create any classes, interfaces, traits that you want.

Features

Installation

Then run command:

php artisan vendor:publish --provider="SiDev\LaravelLayered\LayeredServiceProvider"

Package will use its own base repository and service classes and interfaces, but if you want to use yours, you can redefine them in config/layered.php.

Artisan commands and usage

make:contract

creates a contract (interface) with the given name. It is also possible to specify an extensible interface.

Options

creates a contract that extends another specified contract

Note: the contract that extends will not be created

Examples

make:class

creates a class with the specified name. Using options you can create class with injected dependency and/or implementing the specified interface.

Options

If the name of the contract is specified, the command will create an interface with the specified name and a class that implements the created interface. Otherwise, a contract with the default name (classname + Interface) will be created and a class that implements the created interface.

creates a class with the specified name and injects the specified dependency into the constructor.

this option can only be used with the dependency option. Used if you want to name the injection dependency variable with a different name.

Note: dependency and dependencyName will not create a dependency (class or interface). You should create it manually or using command.

Examples

make:repository

creates a repository with the specified name. It also allows to extends base repository class, create and implement contract, inject the specified model.

Options

extends the specified class. If the name of the class to extend is not defined, it extends the base repository class that defined in package config.

inject the model you specify. Note: the model will not be created, you should create it with appropriate command or manually.

creates and implements the contract for the repository class

All repositories will be placed in the directory App\Repositories. All contracts you can find in the folder App\Contracts\Repositories.

Examples

Base repository interface and class contain the next methods:

In addtition base repository class has magic __call method. So you can use any Eloquent model method you need.

make:service

creates service class in the App\Services folder. Also you can inject repository or model, extends base service class, implement contract.

Options

extends the specified class. If the name of the class to extend is not defined, it extends the base service class that defined in package config.

injects repository class or interface.

injects the specified model.

Notice: you can use either the repository or the model, but not both options together.

creates and implements the contract for the service class

Examples

make:layered-bunch

creates bunch of classes for layered structure. As the result the next ones will be created:

Notice this command only creates contracts and classes, but does not bind abstract to concrete implementation. You should do it manually in AppServiceProvider or other service provider!

Examples

make:trait

creates a trait with the specified name. There is no custom options for this command.

Examples

License

laravel-layered is open-source package licensed under the MIT license


All versions of laravel-layered with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package si-dev/laravel-layered contains the following files

Loading the files please wait ....