Download the PHP package jefhar/laravel-domain-oriented without Composer
On this page you can find all versions of the php package jefhar/laravel-domain-oriented. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-domain-oriented
About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
About Domain Oriented Laravel
First things first, I didn't come up with this re-design of the Laravel Framework. This builds upon the very fine blog posts by Brent. The steps from the first chapter of Brent's blog have already been performed.
Keep your application layer in app/App
directories. This is where you will find the Console
, Exceptions
,
Http
, and Providers
directories. They work the same as the default Laravel application, they're just moved
down one directory, but still in the \App
namespace.
Place your Domain logic organized by domain concern within the app/Domain
directory in the \Domain
namespace.
Support logic should be in the app/Support
directory within the \Support
namespace.
Caveats
Any php artisan make
commands will place the newly created file where stock Laravel expects it to, not where
Domain Oriented Laravel expects it to be. If you need artisan
to create the file, you will need to manually
move it to the correct directory. The default location is acceptable for database and test files.
Additional Changes
Docker
This comes with an opinionated docker stack for unit testing and deployment. Prepackaged with redis, mysql:8.0,
nginx, php:7.4 and mailhog, this stack is easily customizable to suit your needs. Simply add or change a stanza
within the Makefile contains commands to alias common
docker-compose exec
commands.
User Permissions
I have added the spatie/data-transfer-object
and spatie/laravel-permission
packages to the composer
environment. After migrating and seeding, you will have three sample users ; a superAdmin
, an employee
, and
a subscriber
, all with password password
and email address of <username>@example.com
.
The users all have sample roles and permissions which are defined as class constants in the UserRoles and UserPermissions classes.
Modify/remove the migration and
seeder files as needed. You can also add variables to your .env
file
if you want to change the passwords, emails, or usernames.
** Note that the laravel/ui
composer package has not been included.
Composer
I added nunomaduro/larastan
, sensiolabs/security-checker
, and squizlabs/php_codesniffer
to the
development environment. Unless you rely soley on your IDE to tell you that you have possibly
The command composer phpcs
will check your app/
and tests/
directories to make
sure all files are in accordance with PSR-12.
composer phpcbf
will correct any files that it can in those directories to make sure they follow PSR-12.
Running composer pretest
will first check your composer.lock
file to search for any
advisories in the Security Advisories Database. If no
security advisories for your packages exist, it will make sure that larastan
approves of your code. If all is still good, your code will be examined to make sure it is in compliance with
PSR-12 standards.
composer test
will run your unit and feature tests.
Gitlab CI
Domain Oriented Laravel distribution also comes with a CI pipeline for GitLab. By default, it will install the composer and npm dependencies and create a cache, based upon your gitlab repository and branch. It will then, in parallel, run your unit and feature tests, and dusk tests.
If you have installed gitlab-runner locally, either through brew
or a GitLab source, make ci
will run your latest git commit through the unit and feature tests.
When you push a tagged commit to GitLab, the deployment stage will run. Before you do that, create an Envoy.php file. Also create a deployment user on your server with passwordless login:
-
Copy your deployment user's private key to your clipboard. In your GitLab project, go to Settings > CI/CD and expand Secret variables. Paste the ssh_key as an Input variable value, and set the key to
SSH_PRIVATE_KEY
and save the variables.This allows the CD system to open an
ssh
connection to your server. -
Copy your deployment user's public key to your clipboard. In your Gitlab project, go to Settings > Repository and expand Deploy Keys. Paste the public key in the Key field, and give it a name. Remember to Add Key.
This allows GitLab to recognize your user and provides pull authorization from GitLab.
- You may need to give your deployment user
chmod
andchgrp
permissions. This potentially opens your server to an attack vector through theEnvoy.blade.php
file.
You can also add a $LOG_SLACK_WEBHOOK_URL
variable if you want slack notifications upon deployment.
Installation
From your command line, composer create-project jefhar/laravel-domain-oriented
will download and install
the framework. From there, make
will build a base docker container for your development environment. After
the container has been created, make docker
will create all the images needed for a complete development
environment. If you do not need MailHog running just yet, make deploy
will boot all containers except
MailHog. To install composer dependencies, make composerinstall
, and to update composer dependencies, make composerupdate
. Installing npm dependencies is through make yarninstall
. Use make yarnupgrade
to upgrade
the npm dependencies.
Of course, creating your CSS and JavaScript resources are also make
commands: make npmdev
, make npmprod
and make npmwatch
will create your resources. Similar make
commands exist for phpcs
, phpcbf
and a
pretest.
From within the php-fpm container, make refresh
will drop your database, migrate all tables, and seed
sample users.
Update your .env
file and browse to http://localhost:8080
.
Learning Laravel
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.
- Vehikl
- Tighten Co.
- Kirschbaum Development Group
- 64 Robots
- Cubet Techno Labs
- Cyber-Duck
- British Software Development
- Webdock, Fast VPS Hosting
- DevSquad
- UserInsights
- Fragrantica
- SOFTonSOFA
- User10
- Soumettre.fr
- CodeBrisk
- 1Forge
- TECPRESSO
- Runtime Converter
- WebL'Agence
- Invoice Ninja
- iMi digital
- Earthlink
- Steadfast Collective
- We Are The Robots Inc.
- Understand.io
- Abdel Elrafa
- Hyper Host
- Appoly
- OP.GG
- 云软科技
Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
Code of Conduct
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.
License
The Laravel framework is open-sourced software licensed under the MIT license.
All versions of laravel-domain-oriented with dependencies
fideloper/proxy Version ^4.0
laravel/framework Version ^6.2
laravel/tinker Version ^2.0