Download the PHP package deyan-ardi/laravel-layerize without Composer

On this page you can find all versions of the php package deyan-ardi/laravel-layerize. 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-layerize

Laravel Layerize - Develop Laravel App With Layer Architecture

Laravel PHP

What Is Layer Architecture

Gambar

In the Laravel Framework, the standard uses an architecture, namely MVC (Model - View - Controller). This architecture is also included in the example of implementing the Layer Architecture, but there are obstacles that are encountered when we only implement MVC.

This problem is mainly encountered when we start developing a complex and continuous Laravel-based application, the MVC Architecture cannot handle it as a whole because all business logic is located only in the Controller. So if there is a change in the development team, the newly joined team will spend a lot of time studying the previous code.

One of the things that can be done to overcome is to develop from the standard Laravel Framework architecture to a more Clean Code architecture, but the problem is that there is no official standard for this and many novice programmers find it difficult to learn it.

With Laravel Layerize, you can separate the business logic from the Controller and organize your code into clear, separate layers. This package provides a ready-to-use directory structure and best practice approach to organize code according to their respective functions

The Laravel Layerize package has several layers namely:

  • Presentation Layer: The layer closest to the user or the "presentation" of the application. Its main tasks include handling user interaction, such as receiving user input, displaying views, and sending responses to the user. Components in this layer include route, controllers, dto or form validation
  • Business Layer: The layer that contains the business logic or business rules of the application. Its main tasks include orchestrating business processes, performing validation, making decisions, and processing data. This layer is technology-agnostic and responsible for keeping the business logic isolated from other implementation details. Components in this layer include use cases.
  • Persistence Layer: The layer responsible for storing and retrieving data from persistent resources, such as databases or file storage. Its main tasks include performing CRUD (Create, Read, Update, Delete) operations on data. This layer provides an interface to access persistent resources and enables the application to store and retrieve data. Components in this layer include Command Service, Query Service, Datatable Service, and Other Service depend on requirements
  • Database Layer: The layer that directly refers to the database system used by the application. It involves components such as the database server, database schema, tables, and queries. This layer serves as the infrastructure that supports the persistence layer in storing and retrieving data from the database.

By adopting a Laravel Layerize, applications can be well organized, have a clear structure, and separate responsibilities between each layer. This allows for easier maintenance, more structured development, and increases the scalability and flexibility of your application.

Laravel Support Version

Laravel Version Support
4.2.x No
5.x.x No
6.x.x No
7.x.x Yes
8.x.x Yes
9.x.x Yes
10.x.x Yes

System Requerements

How To Install

How To Update

How To Use (Documentation By Layer)

Information

This package support folder generate, you can use "/" for create file in the folder (Ex: Admin/KonfigurasiController => to create class KonfigurasiController in Admin folder)

Presentation Layer

Route

There are no changes to the route, you can implement the route according to the Laravel framework standards

DTO/Validation

DTO/Validation in Laravel Framework is handled by FormRequest. This package helps you create a FormRequest framework for you to validate on the user request side before going to the Controller. To create a FormRequest with Layerize, use the following command

The result of the above command will give a class named StoreUserRequest which will be added to the App/Http/Requests/User folder

Controller

This package helps you create a Controller framework for you to send requests to the next layer. To create a Controller with Layerize, use the following command

The result of the above command will give a class named UserController which will be added to the App/Http/Controllers folder

Business Layer

Use Case

This package helps you create a UseCase framework for you to perform business logic on your application. To create a UseCase with Layerize, use the following command

The result of the above command will give a class named UserUseCase which will be added to the App/Http/UseCase folder

Persistance Layer

Generate All Service Default (QueryService, DatatableService, CommandService)

This package helps you framework all the default services for you to interact with the database layer. To make all services default with Layerize, use the following command

The result of the above command will give three class named UserQuery,UserCommand,UserDatatable which will be added to the App/Services/UserPage/User folder

Generate Single Service

This package helps you framework a services for you to interact with the database layer. To make a services default with Layerize, use the following command

The result of the above command will give a class named ApiProvider which will be added to the App/Services/UserPage folder

Database Layer

Model

There are no changes to the model, you can implement the model according to the Laravel framework standards

General Query Service Function

By configuring the Query Service, we provide some simple custom functions that can be used in Use Case to speed up the process of querying the database

Configuration

  1. Create Query Service
  2. Add Model name in __construction Query Service Class

  3. Call Query Service in Use Case

  4. One Query Service only can integrate with One Model, you can make many Query Service instances of Service

    FirstOrFail

  5. Default parameters firstOrFail($where = [], $with = [], $orderBy = null, $orderDirection = 'asc')

  6. Example usage

First

  1. Default parameters first($where = [], $with = [], $orderBy = null, $orderDirection = 'asc')

  2. Example usage

Get

  1. Default parameters get($where = [], $with = [], $orderBy = null, $orderDirection = 'asc')

  2. Example usage

GetCount

  1. Default parameters getCount($where = [], $with = [], $orderBy = null, $orderDirection = 'asc')

  2. Example usage

Paginate

  1. Default parameters paginate($perPage = 10, $where = [], $with = [], $orderBy = null, $orderDirection = 'asc')

  2. Example usage

Pluck

  1. Default parameters pluck($column, $where = [], $with = [], $orderBy = null, $orderDirection = 'asc')

  2. Example usage

Chunk

  1. Default parameters chunk($size, $callback, $where = [], $with = [], $orderBy = null, $orderDirection = 'asc')

  2. Example usage

First Or New

  1. Default parameters firstOrNew($where = [], $attributes = [])

  2. Example usage

Contributing

Version

License

The Laravel Layerize is open-sourced software licensed under the MIT license.


All versions of laravel-layerize with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|7.4|^8.0|^8.1|^8.2
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 deyan-ardi/laravel-layerize contains the following files

Loading the files please wait ....