Download the PHP package cyberma/laravel-layer-frame without Composer

On this page you can find all versions of the php package cyberma/laravel-layer-frame. 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-layer-frame

Layer Frame for Laravel

A scalable, layered architecture for large Laravel projects

Motivation

Laravel's native Active Record (Eloquent) is fantastic for small and medium-sized projects — but it becomes problematic at scale:

Layer Frame solves these issues by introducing a strict, layered, dependency-flow and complete separation between:

This comes at the cost of more classes, but brings massive benefits:

Core Principles

Layer Frame is built around a few objective architectural rules:

  1. Layered structure (no jumping across layers) Each layer communicates only with the one directly below or above it. No Controller → DB, no Service → DBStorage, no random SQL inside Services.

  2. Composition over inheritance Small composable objects instead of monolithic Models or deep inheritance trees.

  3. Configuration over copy-pasted code Almost everything is controlled via simple configuration arrays:

    • ATTRIBUTES_MAP
    • PRIMARY_KEY
    • JSON_COLUMNS
    • COLUMN_ALIAS_MAP
    • MANDATORY_ATTRIBUTES
  4. 90% typical flows must be easy Simple CRUD is nearly automatic.

  5. The remaining 10% must be fully customizable Every layer has extension points for special logic.

  6. Strict SRP + SOLID No class should do more than one job.

  7. Infrastructure-agnostic DB storage can be swapped, mappings changed, and API formats redesigned without breaking the rest of the code.

Layer Overview

Controllers

Controllers do zero business logic.

Helpers included:

For consistent pagination & search interfaces.

Input Models

Represent incoming request structure.

Inside each InputModel:

InputModel is the only place that "knows" the shape of incoming data.

Input Parsers

InputParser performs:

InputParser is generic; you rarely need a custom implementation.

Services

Services contain all business logic.

A Service:

Services never talk to the database directly.

Repositories

Repositories form the boundary between business logic and persistence.

A Repository uses:

Purpose:

Unlike Eloquent:

Repositories support:

All without exposing SQL to the Service.

Generic Query Execution Architecture

Layer Frame uses typed query DTOs to extend query capabilities without turning repositories into a method-per-query API.

Current separation:

Rationale

Without generic query DTOs, repository/storage APIs quickly grow into method explosion:

Typed query DTOs keep the architecture explicit, maintainable, and AI-friendly:

Architectural rule: keep repositories semantic

Query DTOs are infrastructure primitives. Application/domain repositories should remain semantic services built with composition.

Layer Frame repository architecture guidance:

Good (composition):

Avoid exposing raw SQL-style repository APIs in services/controllers. Use semantic repository methods for common business use-cases, and generic query DTO execution inside repository services.

ScalarQuery examples

CollectionQuery examples

MutationQuery examples

StreamQuery examples

Migration examples

Before:

After:

Before (custom method explosion):

After:

Best practices

JSON and analytics extension guidance

MySQL JSON and grouping/having can be added safely when needed, but keep this policy:

If analytics/query shape is highly specialized, prefer explicit repository methods instead of over-generalizing DTOs.

DBMapper

Maps between:

Responsibilities:

DBMapper is the translator between your domain model and the raw DB.

DBStorage

The only class that actually touches SQL.

Capabilities:

DBStorage is fully generic. It never knows anything about your Models or your domain.

Models

Domain objects representing your internal state. They are not Eloquent models.

Features:

Models contain zero DB logic, zero validation, zero business logic.

Model Maps

Declarative mapping:

ModelMap controls:

ModelMaps enable DB independence.

API Mapper

Converts a Model or collection of Models into a pure array ready for JSON encoding.

Supports:

This is where you shape your external API format.

Exceptions

Layer Frame uses:

A central Handler that:

All exceptions have a code format like: lf21XX

This allows tracking and error reporting across the system.

Data Flow Summary

Reverse direction brings data back mapped to Models, then to APIMapper, then to JSON.

Advantages Over Eloquent

When to Use Layer Frame

Layer Frame is ideal when you have:

Not recommended for tiny CRUD apps — Eloquent is fine there.


🔷 DOMAIN LAYER

This is your business model of a filesystem.

It includes:

✔ Entities (Folder, File, Storage, Permissions)

They:

✔ Value Objects

✔ Domain Services

✔ Domain Factories

Convert attributes + context → domain objects.

❌ Domain Rules

🔷 INFRASTRUCTURE LAYER

This is everything about how and where data is stored or retrieved.

✔ DB Mappers

Convert DB rows → attribute arrays (no business rules, no domain objects)

✔ Storage Adapters

Local disk or S3 are infrastructure concepts.

✔ Repositories (in DDD sense)

Repositories straddle application + infrastructure, but mostly infrastructure:

✔ FS Adapters

Flysystem, local storage, S3 implementations

✔ Database Queries and SQL

❌ Infrastructure Rules


Last update: 13th December 2025.


All versions of laravel-layer-frame with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
laravel/framework Version >=13.0
ext-openssl Version *
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 cyberma/laravel-layer-frame contains the following files

Loading the files please wait ...