PHPackages                             archict/brick - 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. archict/brick

AbandonedArchivedLibrary[Framework](/categories/framework)

archict/brick
=============

Base library for Archict framework

v1.0.4(1y ago)02.5k↓77.8%[2 PRs](https://github.com/Archict/brick/pulls)3MITPHPPHP &gt;= 8.2CI passing

Since Apr 12Pushed 1y agoCompare

[ Source](https://github.com/Archict/brick)[ Packagist](https://packagist.org/packages/archict/brick)[ RSS](/packages/archict-brick/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (7)Dependencies (4)Versions (10)Used By (3)

Archict/Brick
=============

[](#archictbrick)

[![Tests](https://github.com/Archict/brick/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/Archict/brick/actions/workflows/tests.yml)

> To build something, you need bricks

Base library of Archict framework

What is a Brick?
----------------

[](#what-is-a-brick)

A Brick is the base component of Archict. It consists on a collection of [Services](#services) which can have a [Configuration](#services-configuration) and listen to [Event](#events).

How to create a Brick?
----------------------

[](#how-to-create-a-brick)

In technical terms, a Brick is a composer package with the `archict-brick` type. The easiest way to create your own Brick is to use our [template](https://github.com/Archict/brick-template).

If you bring a look at the `composer.json` content, you can see this line:

```
{
  "type": "archict-brick"
}
```

This line is *super mega* important, it's the one telling to Archict that your package is a Brick. Without it, your Services will never be loaded.

You also need to depend on this package to have all the necessary classes to create your Brick.

### Services

[](#services)

Creating a Service is pretty straight forward, just put the attribute Service on your class:

```
