Download the PHP package distilleries/expendable without Composer

On this page you can find all versions of the php package distilleries/expendable. 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 expendable

Scrutinizer Code Quality Code Coverage Build Status Total Downloads Latest Stable Version

Expendable

Expendable is an admin panel base on laravel 5.6.* This package give you some implementation do add a content management system of your application. You can override everything. This Cms give view few tools to develop your content management easily and properly.

Table of contents

  1. Require
  2. Installation
  3. Configurations
  4. Menu
  5. State
    1. Datatable
    2. Order
    3. Export
    4. Import
    5. Form
  6. Component
    1. Admin BaseComponent
    2. Admin ModelBaseController
    3. AdminBaseController
  7. Model
  8. Global scope
    1. Status
  9. Permissions
  10. Views
  11. Assets (CSS and Javascript)
    1. Sass
    2. Images
    3. Javascript
    4. Gulp
  12. Create a new backend module
  13. Case studies
    1. Generate your migration
    2. Generate your model
    3. Generate you component
    4. Add your controller in the routes file
    5. Add to the menu

Require

To use this project you have to install:

  1. Php 7.1.3 or more
  2. Active mpcrypt
  3. Composer https://getcomposer.org/download/
  4. Sass (gem install sass)
  5. NodeJs version v9.4.0

Installation

Add on your composer.json

run composer update.

Add Application override to bootstrap/app.php:

I add a bind event to override the storage path. If you want overrid it juste add STORAGE_PATH= on your .env. If you don't want override it juste to put it on your .env.

Add Service provider to config/app.php:

And Facade (also in config/app.php) replace the laravel facade Mail

Replace the service old facade Mail by the new one.

Publish the configuration:

Configurations

Field Usage
login_uri Uri to access of the login page by default admin/login.
admin_base_uri base of the admin uri admin by default.
config_file_assets File loaded to get the version number of the application. This version number is use to add it of the generated css and javascript to force the reload when you deploy your application.
folder_whitelist Table of folders accessible to display the assets.
listener Table of class autoloaded to listen a custom event.
mail.actions List of action available to send an email. This list is display in email module backend.
menu Use the method \Distilleries\Expendable\Config\MenuConfig::menu() to merge the default menu with your menu. In the table you can define left key or tasks to display in menu left or in the menu task.
menu_left_collapsed Set to tru to keep close the menu left. By default it set to false and the menu is open.
state List of state available, with the color, the logo and the name.

Menu

I use a function to easily merge the default component with the component of the application.

By default you can find on the menu left:

  1. Email
    1. List of email
    2. Add email
  2. User
    1. List of user
    2. Add user
  3. Role
    1. List of role
    2. Add role
  4. Permission
    1. Associate permission
    2. List of service
    3. Add service
    4. Synchronize all services
  5. Language
    1. List of language
    2. Add language

By default you can find on the menu task:

  1. Generate a new component
  2. Synchronize all services

To add a new item it's easy

Option Description
icon Name of the icon class http://getbootstrap.com/components/#glyphicons
action Action call when you click ( use action helper to generate the url)
libelle Translation of your menu item
submenu If you want add sub-item you can add an array with the same options

The method \Distilleries\Expendable\Config\MenuConfig::menu tak two parameters

  1. An array with the content of the meny ['left'=>[],'tasks'=>[]]
  2. The second one is a string beginning or end to define the direction of the merge.

Example of menu left:

menu_left

Example of menu task:

tasks

State

A state is a part of your controller where you define a list of actions. By default I implemented four states:

  1. Datatable
  2. Order
  3. Export
  4. Import
  5. Form

To display the menu of state I provide a class for the interface Distilleries\Expendable\Contracts\StateDisplayerContract.

This class check the interface use on your controller and with the config exependable::state display the logo and the name of the state. If you want change the state display, just provide a new class for the contract Distilleries\Expendable\Contracts\StateDisplayerContract.

To display all the element I use a layout manager. you can override it to display what you want.

1. Datatable

datatable

A datatable state it's use to display a list of content with filter if you need it. To use it you have to implement the interface Distilleries\DatatableBuilder\Contracts\DatatableStateContract.

You can use the trait :

On this trait you have a generic implementation to display the datatable and the data. This trait need to use two attributes of your controller:

  1. $datatable, it's an instance of EloquentDatatable (come from DatatableBuilder).
  2. model, it's and instance of Model (come from laravel).

Inject them on your constructor:

2. Order

Add basic order feature to a component .

Handle Controller

3. Export

export

An export state it's to export the data from your model between two dates. To use it you have to implement the interface Distilleries\Expendable\Contracts\ExportStateContract.

You can use the trait :

On this trait you have a generic implementation to export your data. This trait need to use on attribute of your controller:

  1. model, it's and instance of Eloquant (come from laravel).

Inject them on your constructor:

You can change the class provide to export the data. Just add those methods on your service provider and change the class instantiated.

4. Import

import

An import state it's to import the data from a file to your model. To use it you have to implement the interface Distilleries\Expendable\Contracts\ImportStateContract.

You can use the trait :

On this trait you have a generic implementation to export your data. This trait need to use on attribute of your controller:

  1. model, it's and instance of Eloquant (come from laravel).

Inject them on your constructor:

You can change the class provide to import the data. Just add those methods on your service provider and change the class instantiated.

5. Form

form

The form state give you a part to add or edit an element and a part to view the element without edit.

To use it you have to implement the interface Distilleries\FormBuilder\Contracts\FormStateContract.

You can use the trait :

On this trait you have a generic implementation to display form, save and display view. This trait need to use two attributes of your controller:

  1. model, it's and instance of Eloquant (come from laravel).
  2. form, it's and instance of Form (come from FormBuilder).

Inject them on your constructor:

Component

A component is just a composition of controller, form, datatable, model. To create a new component you can go in /admin/component/edit and fill the form, or use the command line:

You can check the options with the help.

In the backend you have all this options:

Field Description
Name The name use to generate the controllers and other classes (ex: Address, AddressController, AddressForm, AddressDatatable).
State The state you want use on your controller
Model The model inject on your controller
Columns List of columns display on the datatable
Fields The field you want in your form (name:type ex: id:hidden, libelle:text...)

To know all the types of fields you can have look the documentation.

component

Admin BaseComponent

By default if you check all the state that generate a controller inheritance from Distilleries\Expendable\Http\Controllers\Admin\Base\BaseComponent. This controller implement all the states interfaces.

Admin ModelBaseController

If you don't want use all the state and you use a model just extend Distilleries\Expendable\Http\Controllers\Admin\Base\ModelBaseController.

Example:

Admin BaseController

If you don't want use all the state and you don't use a model just extend Distilleries\Expendable\Http\Controllers\Admin\Base\BaseController. You just have to inject the LayoutManagerContract

Example:

Model

By default you can extend \Distilleries\Expendable\Models\BaseModel, this one extend \Illuminate\Database\Eloquent\Model. On it you have some method you can use:

Method Detail
getChoice Return a table with in key the id and the value the libelle
scopeSearch Query scope to search in all columns
getAllColumnsNames Get all the columns of your table
scopeBetweenCreate Query scope to get all the element between to date by the field created_at
scopeBetweenupdate Query scope to get all the element between to date by the field created_at

Global scope

I provide some global scope usable on the model.

Status

If you want display an element only if your are connected use this scope. The model check if the user is not connected and if the status equal online (1).

To use it add the trait on your model use \Distilleries\Expendable\Models\StatusTrait;

Permissions

The system of permission is base on the public method of all your controller. To generate the list of all services use the Synchronize all services (/admin/service/synchronize). That use all the controller and get the public actions.

If you go on Associate Permission you have the list of controller with all methods:

services

On this page you can allow a role to the method. By default Expendable use Distilleries\PermissionUtil package and add the good middleware in his kernel. You don't have to configure something. If the role is not allowed the application dispatch an error 403:

Views

To override the view publish them with command line:

Assets (CSS and Javascript)

All the assets are one the folder resources/assets.

Sass

To use the sass file just add bootstrap and application.admin.scss on your admin file scss. If you check the repo Xyz you have a folder assets. I use the same structure.

Images

The images are copy by mix script when they are found in sass file

Javascript

The javascript is compiled by the mix

Composer

I update my composer json to add the npm install and gulp generation when I update my libraries.

Create a new backend module

  1. Generate your migration.
  2. Generate your model.
  3. Generate you component.
  4. Add your controller in the routes file.

Case studies

Try to create a blog post component. I use a fresh install of Xyz

1. Generate your migration

2. Generate your model

3 Generate you component

I use the backend generator /admin/component/edit.

studies

Datatable:

Form:

This file is generated:

You have to update it for give a value for the choice and give the rules for the validation:

Controller:

4 Add your controller in the routes file

I add Route::controller('post', 'Admin\PostController'); on the route file:

5 Add to the menu

On config/expendable.php id add the Post entry:


All versions of expendable with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
illuminate/support Version 5.8.*
illuminate/database Version 5.8.*
illuminate/translation Version 5.8.*
distilleries/datatable-builder Version 2.14.*
distilleries/form-builder Version 2.13.*
distilleries/permission-util Version 1.10.*
distilleries/security Version 1.1.*
forxer/gravatar Version ~1.2
maatwebsite/excel Version 3.1.*
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 distilleries/expendable contains the following files

Loading the files please wait ....