You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section guides you through configuring the Laravel-CycleORM-Adapter package within your Laravel application. Configuration settings are managed in the `config/cycle.php` file. Ensure you have this file in your project by following the steps outlined in the [Installation](/installation) guide.
9
+
10
+
## 🌎 Environment Variables
11
+
12
+
### Database Connection Variables
13
+
14
+
This section details the environment variables for database connections. Our package uses Laravel's standard variables and introduces additional settings for CycleORM integration. Configure these in your `.env` file as needed or override them in your `config/cycle.php` file.
15
+
16
+
These are variables, that will be in `.env` file of your Laravel project from the box, and are used by `config/cycle.php` to configure CycleORM.
["CYCLE_SCHEMA_WARMUP", "boolean", "true", "Indicates whether the schema cache should be preloaded."],
50
+
["CYCLE_REGISTER_ENTITY_BEHAVIOUR", "boolean", "true", "Enables support of `SoftDelete` and other behaviours from <a class=\"nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]\" target=\"_blank\" href=\"https://github.com/cycle/entity-behavior\">cycle/entity-behavior</a>"]
@@ -28,8 +29,8 @@ The latest changes are always in master branch, so please make your Pull Request
28
29
29
30
## ✉️ Git Message Format
30
31
31
-
This repo adheres to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
32
-
Commit messages are enforced through [commitizen](https://github.com/commitizen-tools/commitizen) and a [pre-commit](https://pre-commit.com), please use `make hooks` to install them.
32
+
This repo adheres to the <ExternalLinkhref="https://www.conventionalcommits.org/en/v1.0.0/">Conventional Commits</ExternalLink> specification.
33
+
Commit messages are enforced through <ExternalLinkhref="https://github.com/commitizen-tools/commitizen">commitizen</ExternalLink> and a <ExternalLinkhref="https://pre-commit.com">pre-commit</ExternalLink>, please use `make hooks` to install them.
33
34
34
35
This leads to more readable messages that are easy to follow when looking through the project history and also allows to generate changelogs automatically.
35
36
@@ -61,15 +62,15 @@ $ make test
61
62
62
63
### → Static Analysis
63
64
64
-
Run Code quality checks using [PHPStan](https://phpstan.org):
65
+
Run Code quality checks using <ExternalLinkhref="https://phpstan.org">PHPStan</ExternalLink>:
65
66
66
67
```bash
67
68
$ make lint-stan
68
69
```
69
70
70
71
### → Coding Standards Fixing
71
72
72
-
Fix code using [The PHP Coding Standards Fixer](https://github.com/wayofdev/php-cs-fixer-config) to follow our standards:
73
+
Fix code using <ExternalLinkhref="https://github.com/wayofdev/php-cs-fixer-config">The PHP Coding Standards Fixer</ExternalLink> to follow our standards:
73
74
74
75
```bash
75
76
$ make lint-php
@@ -81,4 +82,4 @@ If you discover a security vulnerability within this package, please send an e-m
81
82
82
83
## 🤝 Code of Conduct
83
84
84
-
We are using the [Contributor Covenant](https://www.contributor-covenant.org/) as our Code of Conduct, to keep discussion open and inclusive. Please, take a moment to read and follow our [Code of Conduct](https://github.com/wayofdev/laravel-cycle-orm-adapter/blob/master/.github/CODE_OF_CONDUCT.md).
85
+
We are using the <ExternalLinkhref="https://www.contributor-covenant.org">Contributor Covenant</ExternalLink> as our Code of Conduct, to keep discussion open and inclusive. Please, take a moment to read and follow our <ExternalLinkhref="https://github.com/wayofdev/laravel-cycle-orm-adapter/blob/master/.github/CODE_OF_CONDUCT.md">Code of Conduct</ExternalLink>.
Unlock the full potential of [Domain-Driven Design](https://en.wikipedia.org/wiki/Domain-driven_design) in your Laravel projects with the [wayofdev/laravel-cycle-orm-adapter](https://github.com/wayofdev/laravel-cycle-orm-adapter) — the adapter package that seamlessly integrates the capabilities of [CycleORM](https://cycle-orm.dev) — DataMapper ORM into [Laravel Framework](https://laravel.com).
5
+
Unlock the full potential of Domain-Driven Design in your Laravel projects with the <ExternalLinkhref="https://github.com/wayofdev/laravel-cycle-orm-adapter">laravel-cycle-orm-adapter</ExternalLink> — the adapter package that seamlessly integrates the capabilities of <ExternalLinkhref="https://cycle-orm.dev">CycleORM</ExternalLink> — DataMapper ORM into <ExternalLinkhref="https://laravel.com">Laravel Framework</ExternalLink>.
4
6
5
-
This adapter bridges the gap between Laravel's rapid development capabilities and Cycle ORM's Data Mapper features, enabling you to craft complex, domain-centric applications, with separation of concerns, and a clear distinction between the domain model and the persistence layer.
7
+
This adapter bridges the gap between Laravel's rapid development capabilities and CycleORM's Data Mapper features, enabling you to craft complex, domain-centric applications, with separation of concerns, and a clear distinction between the domain model and the persistence layer.
6
8
7
9
## 🧐 Understanding the Limitations of Eloquent
8
10
@@ -19,15 +21,15 @@ The Active Record pattern tightly couples domain logic and data persistence with
19
21
20
22
There were many attempts to bring DDD to Laravel:
21
23
22
-
*[Laravel Beyond CRUD approach](https://laravel-beyond-crud.com) by Spatie
24
+
*<ExternalLinkhref="https://laravel-beyond-crud.com">Laravel Beyond CRUD approach</ExternalLink> by Spatie
23
25
24
-
*[Conciliating Laravel and DDD](https://lorisleiva.com/conciliating-laravel-and-ddd) by Loris Leiva
26
+
*<ExternalLinkhref="https://lorisleiva.com/conciliating-laravel-and-ddd">Conciliating Laravel and DDD</ExternalLink> by Loris Leiva
25
27
26
-
*[Yet another Laravel 10 DDD interpretation](https://github.com/Orphail/laravel-ddd)
28
+
*<ExternalLinkhref="https://github.com/Orphail/laravel-ddd">Yet another Laravel 10 DDD interpretation</ExternalLink>
27
29
28
30
these often involve workarounds to adapt Eloquent rather than a fundamental shift in approach.
29
31
30
-
The `laravel-cycle-orm-adapter` bridges this gap, by introducing DataMapper pattern capabilities to Laravel, empowering you to unlock the full potential of DDD within your projects.
32
+
The <ExternalLinkhref="https://github.com/wayofdev/laravel-cycle-orm-adapter">laravel-cycle-orm-adapter</ExternalLink> bridges this gap, by introducing DataMapper pattern capabilities to Laravel, empowering you to unlock the full potential of DDD within your projects.
31
33
32
34
Here's why this combination shines:
33
35
@@ -40,20 +42,20 @@ Here's why this combination shines:
40
42
41
43
## 🚀 Features
42
44
43
-
### Laravel Cycle ORM Adapter Features
44
-
-**Seamless Integration**: The adapter is designed to work seamlessly with Laravel, allowing you to use Cycle ORM in your Laravel projects without any hassle.
45
+
### Laravel CycleORM Adapter Features
46
+
-**Seamless Integration**: The adapter is designed to work seamlessly with Laravel, allowing you to use CycleORM in your Laravel projects without any hassle.
45
47
-**Entity as Source of Truth for Database Migrations**: The adapter allows you to use your domain entities as the source of truth for your database schema, making it easier to keep your database schema in sync with your domain model.
46
-
-**Laravel Collections Support**: The adapter provides support for [Laravel Collections](https://laravel.com/docs/10.x/collections), allowing you to use them with your domain models and repositories
47
-
-**Database Factories**: Use Laravel database seeders together with CycleORM Entity Factories via [wayofdev/laravel-cycle-orm-factories](https://github.com/wayofdev/laravel-cycle-orm-factories)
48
-
-**Real Repositories**: [Avoid breaking the Repository Design Pattern in Laravel](https://medium.com/@sergiumneagu/laravel-why-youve-been-using-the-repository-pattern-the-wrong-way-952aedf1989b), maintaining a clear separation between your domain logic and the persistence layer.
48
+
-**Laravel Collections Support**: The adapter provides support for <ExternalLinkhref="https://laravel.com/docs/10.x/collections">Laravel Collections</ExternalLink>, allowing you to use them with your domain models and repositories
49
+
-**Database Factories**: Use Laravel database seeders together with CycleORM Entity Factories via <ExternalLinkhref="https://github.com/wayofdev/laravel-cycle-orm-factories">wayofdev/laravel-cycle-orm-factories</ExternalLink>
50
+
-**Real Repositories**: <ExternalLinkhref="https://medium.com/@sergiumneagu/laravel-why-youve-been-using-the-repository-pattern-the-wrong-way-952aedf1989b">Avoid breaking the Repository Design Pattern in Laravel</ExternalLink>, maintaining a clear separation between your domain logic and the persistence layer.
49
51
50
52
51
-
### Cycle ORM Features
52
-
-**Domain-Driven Design**: Cycle ORM is designed to work with complex domain models, making it a perfect fit for DDD.
53
-
-**Data Mapper**: Cycle ORM is a Data Mapper ORM, which means that it allows you to define your domain models and their relationships in a way that is more natural and expressive.
54
-
-**Powerful Query Builder**: Cycle ORM provides a powerful query builder that allows you to write complex queries in a way that is easy to read and understand.
55
-
-**Schema Management**: Cycle ORM provides powerful schema management capabilities, allowing you to define your database schema using PHP code.
53
+
### CycleORM Features
54
+
-**Domain-Driven Design**: CycleORM is designed to work with complex domain models, making it a perfect fit for DDD.
55
+
-**Data Mapper**: CycleORM is a Data Mapper ORM, which means that it allows you to define your domain models and their relationships in a way that is more natural and expressive.
56
+
-**Powerful Query Builder**: CycleORM provides a powerful query builder that allows you to write complex queries in a way that is easy to read and understand.
57
+
-**Schema Management**: CycleORM provides powerful schema management capabilities, allowing you to define your database schema using PHP code.
56
58
57
59
## 🛠️ Want to see it in action?
58
60
59
-
Explore the Laravel CycleORM Starter Kit project: [laravel-cycle-orm-starter-kit](https://github.com/wayofdev/laravel-cycle-starter-tpl), based on Laravel 10.x. It showcases the practical use of the adapter in a real-world application, demonstrating how to leverage CycleORM's strengths within a Laravel project.
61
+
Explore the Laravel CycleORM Starter Kit project: <ExternalLinkhref="https://github.com/wayofdev/laravel-cycle-starter-tpl">laravel-cycle-orm-starter-kit</ExternalLink>, based on Laravel 10.x. It showcases the practical use of the adapter in a real-world application, demonstrating how to leverage CycleORM's strengths within a Laravel project.
Welcome to the installation guide for the Laravel Cycle ORM Adapter. This document will walk you through the setup process to get you up and running quickly.
5
+
Welcome to the installation guide for the Laravel CycleORM Adapter. This document will walk you through the setup process to get you up and running quickly.
4
6
5
7
## 🚩 Prerequisites
6
8
@@ -11,15 +13,15 @@ Before you begin, ensure your development environment meets the following requir
11
13
12
14
## 🧩 Compatibility Map
13
15
14
-
| Laravel |Cycle ORM| Adapter |
15
-
|---------|-----------|---------|
16
-
| ^10.28 | 2.x | 4.x |
17
-
| 11.x | 2.x | ^4.9.0 |
16
+
| Laravel |CycleORM| Adapter |
17
+
|---------|----------|---------|
18
+
| ^10.28 | 2.x | 4.x |
19
+
| 11.x | 2.x | ^4.9.0 |
18
20
19
21
20
22
## 🚀 Quick Start
21
23
22
-
Installing the Laravel Cycle ORM Adapter is straightforward with Composer. Follow the steps below to add the adapter to your Laravel project.
24
+
Installing the Laravel CycleORM Adapter is straightforward with Composer. Follow the steps below to add the adapter to your Laravel project.
23
25
24
26
<divclassName="steps-container">
25
27
@@ -31,7 +33,7 @@ For the core functionality, run the following Composer command in your terminal:
31
33
$ composer req wayofdev/laravel-cycle-orm-adapter
32
34
```
33
35
34
-
This command installs the wayofdev/laravel-cycle-orm-adapter package, integrating Cycle ORM into your Laravel application.
36
+
This command installs the wayofdev/laravel-cycle-orm-adapter package, integrating CycleORM into your Laravel application.
If you need support for [Eloquent-like Factories](https://laravel.com/docs/10.x/eloquent-factories), install the following package:
51
+
If you need support for <ExternalLinkhref="https://laravel.com/docs/11.x/eloquent-factories">Eloquent-like Factories</ExternalLink>, install the following package:
which will install the [wayofdev/laravel-cycle-orm-factories](https://github.com/wayofdev/laravel-cycle-orm-factories) package to provide similar functionality
57
+
which will install the <ExternalLinkhref="https://github.com/wayofdev/laravel-cycle-orm-factories">wayofdev/laravel-cycle-orm-factories</ExternalLink> package to provide similar functionality
0 commit comments