Download the PHP package laramate/nucid-architecture without Composer
On this page you can find all versions of the php package laramate/nucid-architecture. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laramate/nucid-architecture
More information about laramate/nucid-architecture
Files in laramate/nucid-architecture
Package nucid-architecture
Short Description The Nucid Architecture for Laravel
License MIT
Informations about the package nucid-architecture
The Nucid Architecture for Laravel
- Description
- Nucid Architecture
- Services
- Features
- Domains
- Jobs and operations
- Nucid Implementation
- Installation
- Setting up Services
- Configuration
- Additional tasks
- Further Information
- Changelog
- License
Description
The Nucid Architecture for Laravel is a software architecture for structuring a Laravel application based on services. Nucid supports you to build large scale applications and keep them maintainable. In comparison to other approaches, it keeps the Laravel concepts as they are, flexible and customizable.
This project is inspired by The Lucid Architecture developed by Abed Halawi. We made some adjustments to the core concepts and wrote a new package-based implementation with a lot of new features.
The documentation is still in progess... sorry :)
Nucid Architecture
The main goal of the Nucid Architecture for Laravel is to give you and your team and application structure which is high scalable, easy maintainable and prevents redundancies.
Services
Modern webapplications have to do a lot more tasks than just displaying frontend websites. They have to deliver content in different formats, need a backend to get administrated and offering APIs to communicate with other solutions. Instead of doing all these things anywhere in your project, we seperate them into different parts. Thats what we call a service in Nucid. It consists of features.
Features
A feature do not implement any concrete logic, it controls which jobs and operations will be dispatched to solve the requested tasks for the current service.
Note that jobs, operations and features are provided in the seperate package Laramate/composite. This allows you to reuse them in other projects no matter if they are using the Nucid Architecture or not.
Domains
As in many architecture concepts, the domains implement the business logic. A domain is a thematically group of concrete implementions and can consist of models, value objects, factories, utility classes etc. It offers jobs and operations that can be called from the features.
Nucid does not define more conventions for the structure of the domains. There are a lot concepts for that and most of them are good solutions and there is no reason to force a common structure. Quite the contrary: It can be usefull to adjust it to your project size and needings.
Jobs and operations
work in progress
Note that jobs and operations are implementing Laravel's queuing and serializing Trait. So you can do all the things which you know from the Laravel jobs.
Nucid Implementation
Installation
You can install the package via composer.
After the composer installation you can customize paths in the Nucid configuration.
After you finished configuration, use the Nucid Artisan command to setup required directories and files. This will not override any existing files and folders.
At least, you should remove the laravel route service provider from the configuration file.
Setting up Services
Publish the Nucid services configuration file:
After that you can find the configuration file in the standard Laravel folder.
It contains an array with the service confiuration where the key is the service name. Here is an example:
Service Options
Subdomain
If you set up a subdomain for the service, the service will only be loaded if the subdomain matches. For example
would match api.example.com.
Route prefix
If you set up a route prefix, the service will only be loaded if it matches the beginning of the request URI. For example
would match www.example.com/backend
Relative path
Set up the relative path of the service. All services will be resolved by using the , which you can change in the Nucid configuration. For example:
Configuration
Usually you don't need to publish the Nucid configuration file, because nearly all of the options can be overwritten by setting up env options.
However, if you want to configure it directly, you can publish the Nucid configuration with:
After that you can find the configuration file in the standard Laravel folder.
Activate/Deactivate Nucid Service System
You can activate or deactivate the whole nucid services system.
Or set up the following option in your .env file:
Default Service
You can set the default service manually. If you leave it blank, the first service in the service configuration will be used.
Or set up the following option in your .env file:
Service Base path
The Nucid services base path:
Or set up the following option in your .env file:
Domains path
The domains path:
Or set up the following option in your .env file:
Nucid services subfolders
Or set up the following options in your .env file:
Nucid Services file names
Or set up the following options in your .env file:
Additional tasks
Moving the User Model to your Domain folder
Create a Folder inside you domain directory. Then move the standard Laravel user model in this directory. Open the file and fix the namespace.
Now open the Laravel auth config in the default config directory . Set up the moved user model.
Further Information
Changelog
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
© 2019 Laramate • MIT License • www.laramate.de • github.com/Laramate