Download the PHP package garmonic/laravel-features-arch without Composer

On this page you can find all versions of the php package garmonic/laravel-features-arch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-features-arch

Laravel Features Architecture

Description

This package helps you to divide your Laravel project code by features, encapsulated in separate folders. Each feature has its own container, configuration, routes, views and providers. You can enable and disable your features in general config file.

Installation

  1. Use following composer command in your terminal:

composer require garmonic/laravel-features-arch

If file config/features.php has not been created, run such command:

php artisan vendor:publish --provider='Garmonic\FeaturesArch\Providers\FeatureServiceProvider'

  1. Add to composer.json file (section "psr-4" in "autoload") following string:

"Features\\": "features/",

Usage

Creating new feature

To create new feature, run console command:

php artisan make:feature with name of your feature, for example:

php artisan make:feature Warehouse

If you wish to specify routes beginning for feature, use option route with its value, example for beginning /wh/:

php artisan make:feature Warehouse --route=wh

Route base should not start with slash, but can contain it inside. By default, route base will be made from feature name converted to lower case.All routes will be automatically prefixed by specified or generated beginning.

Finally, new folder /features/{your-feature-name} will appear in your project. It will be place of new feature.

Enabling and disabling features

To enable feature, add its name and main class name (Features\\{name}\\Feature::class) to config/features.php (section "list").

To disable it, comment its string in the same config file.

Feature folder files structure

You can read config from it using Feature::config(). In controller: $this->feature->config('main.config_key', 'default');

Also you can add your own config files to feature config folder and use them in the same way.

You can create your own controllers for feature, each of them should extend Garmonic\FeaturesArch\BaseController and contain correct featureName property.

You can use global container (App::singleton() or App::bind()) or feature container ($this->feature->singleton() or $this->feature->bind()).

You can add your own views and use them in controllers like this: return $this->feature->view('view_name', ['data'=>'some_data']); Also, each view has $feature variable to have access to feature instance.

Links to feature routes can be generated using Feature::route() method.

In controller: $this->feature->route('route_name', ['data'=>'some_data']);

In view: {{ $feature->route('route_name', ['data'=>'some_data']) }}

About author

Alexey Vasilyev, https://github.com/garmonic


All versions of laravel-features-arch with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
laravel/framework Version ^8.0|^9.0
symfony/finder Version ^5.0|^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package garmonic/laravel-features-arch contains the following files

Loading the files please wait ....