A modified version of the Laravel Framework

Related tags

Frameworks hexavel
Overview

Hexavel Framework

Hexavel is a restructured version of Laravel, with the purpose of providing better work flows which will simplify the development process.

Install

To install via composer simply use the command

composer create-project --prefer-dist peterfox/hexavel <name of your project>

What's different from Laravel?

File structure

Hexavel uses a widely changed filesystem from Laravel with which to produce a working application. Each folder is explained before so you can understand where to find or place your own work.

Binaries (bin)

This is where all our console applications go, including the artisan console and the binaries install via composer. All of artisan's commands work the same as Laravel except now you must use bin/artisan instead from the root directory of your application.

Source (src)

This is where our base PHP application code goes using the default namespace \App.

Application (app)

For the moment this simply stores our applications configs and routing files.

Support

This is our biggest change from Laravel. Support is how it sounds, a directory for all files that support the development of our application. This covers views, assets, language files, tests and migrations by default.

There is also a support packages folder which is the suggested place for local packages you might be developing or sit as part of your project to be loaded via composer.

Variable (var)

Variable directory is effectively our application writable directory. All caches and data written by the application should be stored under this directory. Examples would be the bootstrap cache, logs or an sqlite database.

Hexagonal Architecture

Hexagonal architecture is a fancy name for a simple concept, you should separate your code into what's your framework, your domain and the connections between services and or libraries that your application interacts with.

Laravel

Code that relates to the core of your application in this case Laravel specific code like service providers or controllers.

Bridge

Code that relates to services or libraries that are used by the application.

Domain

Code which is unique to your business requirements and is separate to the bridge and framework.

Repository Pattern built in

The repository pattern is really important and it's useful when working with the Models you'll create using Eloquent. To make this easier there's a service provider included which allows you to map your models to repositories and in turn map repository interfaces from your domain to your model interfaces.

Example Repository:

namespace App\Bridge\Eloquent;

use App\Bridge\Eloquent\Model\User;
use App\Domain\AuthenticatableRepository as AuthenticatableRepositoryInterface;
use Hexavel\Repository\EloquentRepository;
use Illuminate\Contracts\Auth\Authenticatable;

class AuthenticatableRepository extends EloquentRepository implements AuthenticatableRepositoryInterface
{
    public function getModel()
    {
        return User::class;
    }

    /**
     * @param string $email
     * @return Authenticatable
     */
    public function findByAuthIdentifier($email)
    {
        return $this->model->where('email', $email)->first();
    }
}

Then add the model and repositories to the service provider.

namespace App\Laravel\Providers;

use App\Bridge\Eloquent\Model\User;
use App\Bridge\Eloquent\AuthenticatableRepository;
use App\Domain\AuthenticatableRepository as AuthenticatableRepositoryInterface;
use Hexavel\Support\Providers\RepositoryProvider as ServiceProvider;

class RepositoryServiceProvider extends ServiceProvider
{

    /**
     * @return string[]
     */
    protected function getModelRepositories()
    {
        return [
            AuthenticatableRepository::class => User::class
        ];
    }

    /**
     * @return string[]
     */
    protected function getRepositories()
    {
        return [
            AuthenticatableRepositoryInterface::class => AuthenticatableRepository::class
        ];
    }
}

Testing

Testing is a huge part of any good application that you're developing. Hexavel includes a simple setup for using both Behat and PHPSpec to allow you to test both the features and the code you develop.

Behat

Your feature files can be created under support/features, while the feature context for your test suite is under support/context. You can run tests via bin/behat or by calling gulp behat.

To make separating the code easier the set up is ready for using the page pattern as a way of managing the interactions with your application for testing via Behat.

PHPSpec

Class specs are stored in support/spec they can be created simply by using the phpspec command bin/phpspec desc <Namespace\\Class> and then you can call bin/phpspec run or gulp phpSpec to perform the tests.

Warnings

Not all packages made for Laravel will work out of the box with Hexavel. Most will except if they install code into your project. Laravel Spark is an example of this when it uses a number of stubs and adds assets etc.

Other Resources

  • Hexavel Sparkis a package for making Spark compatible with Hexavel due to the install of stubs.
  • Hexavel Componentssits between Laravel Framework and Hexavel.
  • Hexavel Behatholds the contexts that sets up Behat for Hexavel.
You might also like...
Rori-PHP is custom non production web application framework inspired by Laravel syntax

Rori-PHP is custom non production web application framework inspired by Laravel syntax. A web framework provides a structure and starting point for your application allowing you to focus on creating something amazing.

The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit.

Slim & Eloquent The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit. Getting started # Download composer curl -s https://ge

Volistx Framework For RESTful API Based on Laravel/Lumen 9.x

Volistx Framework Volistx Framework For RESTful API Based on Laravel/Lumen 9.x This is a framework skeleton for Volistx API platform using Lumen PHP F

A PHP framework for web artisans.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

The Symfony PHP framework

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Symfony is used by thousands of web applications (in

Open Source PHP Framework (originally from EllisLab)

What is CodeIgniter CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable

Yii 2: The Fast, Secure and Professional PHP Framework
Yii 2: The Fast, Secure and Professional PHP Framework

Yii 2 is a modern framework designed to be a solid foundation for your PHP application. It is fast, secure and efficient and works right out of the bo

CakePHP: The Rapid Development Framework for PHP - Official Repository

CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Associative Data Mapping, Front Controller, and MVC. O

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim Framework Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. Installation It's recommended

Comments
Owner
Peter Fox
Primarily a PHP/Laravel Developer who also dips a toe into NodeJS and Go from time to time.
Peter Fox
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

Rizky Alamsyah 14 Aug 14, 2022
CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework

CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework. It is free, Open Source and is distributed under Free Public Lice

Nazar Mokrynskyi 150 Apr 12, 2022
PHPR or PHP Array Framework is a framework highly dependent to an array structure.

this is new repository for php-framework Introduction PHPR or PHP Array Framework is a framework highly dependent to an array structure. PHPR Framewor

Agung Zon Blade 2 Feb 12, 2022
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Framework X Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. Quickstart Documentation Tests

Christian Lück 620 Jan 7, 2023
Framework X is a simple and fast micro framework based on PHP

Framework X is a simple and fast micro framework based on PHP. I've created a simple CRUD application to understand how it works. I used twig and I created a custom middleware to handle PUT, DELETE methods.

Mahmut Bayri 6 Oct 14, 2022
Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components

Spiral HTTP Application Skeleton Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components.

Spiral Scout 152 Dec 18, 2022
Sunhill Framework is a simple, fast, and powerful PHP App Development Framework

Sunhill Framework is a simple, fast, and powerful PHP App Development Framework that enables you to develop more modern applications by using MVC (Model - View - Controller) pattern.

Mehmet Selcuk Batal 3 Dec 29, 2022
A magic PHP framework. Build reactive web apps without writing HTML, CSS, or JavaScript! Powered by Tailwind, Alpine, Laravel, & Livewire.

Malzahar A magic PHP framework. Build reactive web apps without writing HTML, CSS, or JavaScript! Powered by Tailwind, Alpine, Laravel, & Livewire. Re

null 26 Nov 17, 2022
An intelligent code generator for Laravel framework that will save you time

An intelligent code generator for Laravel framework that will save you time! This awesome tool will help you generate resources like views, controllers, routes, migrations, languages and/or form-requests! It is extremely flexible and customizable to cover many of the use cases. It is shipped with cross-browsers compatible template, along with a client-side validation to modernize your application.

CrestApps 621 Jan 8, 2023
💡 Mudrock is a MVC PHP framework, which was inspired by the Laravel and CodeIgniter frameworks.

?? Mudrock is a MVC PHP framework, which was inspired by the Laravel and CodeIgniter frameworks

null 3 Nov 17, 2021