• Stars
    star
    7
  • Rank 2,294,772 (Top 46 %)
  • Language
    PHP
  • Created about 9 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A modified version of the Laravel Framework

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.

More Repositories

1

laravel-webhook-demo

The example code for the article https://medium.com/@SlyFireFox/laravel-innovations-making-your-own-webhook-mechanism-through-notifications-96e75e99a2b1
PHP
17
star
2

laravel-elixir-mjml

A task plugin for running MJML templates in Laravel Elixir
JavaScript
11
star
3

openai-laravel-demo

A demo app for using OpenAI with Laravel
PHP
7
star
4

macros-demo

A Demo for Macros
PHP
7
star
5

nova-social-login-demo

A demo for how to implement Social Logins for Laravel Nova
PHP
5
star
6

laravel-runscope

A PHP library for making it easy to use Runscope with your web hooks and external API calls
PHP
5
star
7

notifications-demo

The code in this project is an example of how to create a simple streamlined email unsubscribe mechanism for Laravel's notification system
PHP
5
star
8

hieroglyph

A package to simplify changing between different icon sets
PHP
3
star
9

roadrunner-plugin-template

Template project for a RoadRunner plugin
Go
3
star
10

bitpayclient

An OOP PHP client for interacting with the BitPay API
PHP
2
star
11

validation-rule-demo

The example code for the article https://medium.com/@SlyFireFox/test-driven-development-for-custom-laravel-validation-rules-669d01e34a65
PHP
2
star
12

seo-demo

The code in this project is an example of how to create root level URLs for dynamic content without causing wildcard clashes
PHP
2
star
13

make-command-demo

A demo for making new Make commands in Laravel
PHP
2
star
14

laravel-incident-logs-demo

The example code for the article https://medium.com/@SlyFireFox/laravel-how-to-make-incident-logs-d7fa88e48490
PHP
2
star
15

hexavel-spark

A library for making installs of Spark compatible with Laravel Spark
PHP
1
star
16

torino

An example of a simple Onion address generator
JavaScript
1
star
17

graphaware-reco-client-php

A configurable PHP library for fetching recommendations from a GraphAware Recommendation setup
PHP
1
star
18

waitformysql

A mini golang util for waiting for a mysql database to be up
Go
1
star
19

laravel-casts-examples

A demo for Laravel Custom Casts with common examples for Money, Location/Address and Date Intervals
PHP
1
star
20

testing-trait-hooks-demo

Demo for Trait hooks to use in Test Cases
PHP
1
star
21

custom-make-model-command

A demo for customising the Laravel make model command to use singular table names.
PHP
1
star