PHPackages                             lab1353/monkyz - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. lab1353/monkyz

AbandonedArchivedProject[Admin Panels](/categories/admin)

lab1353/monkyz
==============

Dynamic and autonomous Administration Panel for Laravel 5

1.0.13(8y ago)294MITCSSPHP &gt;=5.5.9

Since Oct 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/danielemontecchi/monkyz)[ Packagist](https://packagist.org/packages/lab1353/monkyz)[ Docs](http://1353.it)[ RSS](/packages/lab1353-monkyz/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (5)Versions (15)Used By (0)

[![Monkyz](https://raw.githubusercontent.com/lab1353/monkyz/master/assets/images/logo/monkyz_dark_80.png)](https://raw.githubusercontent.com/lab1353/monkyz/master/assets/images/logo/monkyz_dark_80.png)

[![screenshot](https://raw.githubusercontent.com/lab1353/monkyz/master/resources/assets/images/readme/screenshot.png)](https://raw.githubusercontent.com/lab1353/monkyz/master/resources/assets/images/readme/screenshot.png)

[![monkyz logo](https://raw.githubusercontent.com/lab1353/monkyz/master/assets/images/logo/monkyz_24.png)](https://raw.githubusercontent.com/lab1353/monkyz/master/assets/images/logo/monkyz_24.png) Monkyz :: dynamic admin panel
==================================================================================================================================================================================================================================

[](#-monkyz--dynamic-admin-panel)

[![lab1353](https://camo.githubusercontent.com/480fe5dfb3ed9a447289864f98b348b4a16ce0efec035ebc05a7d7fdb1a4fd27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706f776572656425323062792d6c6162313335332d627269676874677265656e2e737667)](http://1353.it)[![Total Downloads](https://camo.githubusercontent.com/e7977af813cf208cdc7da4c40b1342571a85ffe013e7dde01f3f90eb22910259/68747470733a2f2f706f7365722e707567782e6f72672f6c6162313335332f6d6f6e6b797a2f646f776e6c6f616473)](https://packagist.org/packages/lab1353/monkyz)[![Latest Stable Version](https://camo.githubusercontent.com/ed64a0a5d69dd0017afc09fb530fe3b0c0fc4d174aa46489c011623917ace5a5/68747470733a2f2f706f7365722e707567782e6f72672f6c6162313335332f6d6f6e6b797a2f762f737461626c65)](https://packagist.org/packages/lab1353/monkyz)[![Latest Unstable Version](https://camo.githubusercontent.com/4d44a6dc33931c6e1185bd88fdf5e56db47ca9feca76300c6d6849fe3d46df2f/68747470733a2f2f706f7365722e707567782e6f72672f6c6162313335332f6d6f6e6b797a2f762f756e737461626c65)](https://packagist.org/packages/lab1353/monkyz)[![License](https://camo.githubusercontent.com/747a4bd06aac3eaba8b8e0e3bb3cc2e919a73040189b995f54763bf9db2592d3/68747470733a2f2f706f7365722e707567782e6f72672f6c6162313335332f6d6f6e6b797a2f6c6963656e7365)](https://packagist.org/packages/lab1353/monkyz)

**Monkyz** is a dynamic and autonomous Administration Panel for *Laravel 5.2* .

It adapts to existing database by creating a full CRUD management for any table existing. No configuration required: without writing a single line of code, your control panel is ready for use.

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
    - [General Informations](#general-informations)
        - [Assets Files](#assets-files)
        - [Tables Relationships](#tables-relationships)
- [Configuration](#configuration)
    - [File `monkyz.php`](#file-monkyzphp)
    - [File `monkyz-tables.php`](#file-monkyz-tablesphp)
        - [Parameter `tables`](#parameter-tables)
            - [Table Parameters](#table-parameters)
            - [Fields Parameters](#fields-parameters)
- [Authentication](#authentication)
- [Artisan Commands](#artisan-commands)
    - [`monkyz:tables`](#monkyztables)
- [Customize](#customize)
    - [Custom Fields](#custom-fields)
- [Google Analytics](#google-analytics)
- [Troubleshooting](#troubleshooting)
- [Change Log](#change-log)
- [Into The Future](#into-the-future)
- [Credits](#credits)
    - [Links](#links)
    - [Vendors](#vendors)
    - [Tools](#tools)
- [Copyright and License](#copyright-and-license)

Requirements
------------

[](#requirements)

The requirements are:

- PHP &gt;= 5.5.9
- Laravel 5.2

Installation
------------

[](#installation)

First, pull in the package through Composer:

```
php composer.phar require lab1353/monkyz
```

or, for the latest version, in development (it may not be stable):

```
php composer.phar require lab1353/monkyz:dev-master
```

And then, within `config/app.php`, include the service provider:

```
'providers' => [
	Lab1353\Monkyz\MonkyzServiceProvider::class,
];
```

Finally, publish the assets:

```
php artisan vendor:publish --provider="Lab1353\Monkyz\MonkyzServiceProvider"
```

This command will publish:

- views in: `resources/views/vendor/monkyz/`
- configuration files: `config/`
- assets: `public/vendor/monkyz/`

### General Informations

[](#general-informations)

#### Assets Files

[](#assets-files)

The file `css/monkyz.min.css` was generated by a SCSS file. If you are interested in changing the SCSS source files, you can find here: `vendor/lab1353/monkyz/resources/assets/scss/`.

The file `public/vendor/monkyz/js/monkyz.min.js` has been compressed. The original files are in: `vendor/lab1353/monkyz/resources/assets/js/`.

#### Tables Relationships

[](#tables-relationships)

Relations between tables must follow directions imposed by Eloquent. For more information read the section [Eloquent: Relationships](https://laravel.com/docs/5.2/eloquent-relationships)

> **Monkyz** currently only supports one-to-one and many-to-one relationships.

Configuration
-------------

[](#configuration)

### File `monkyz.php`

[](#file-monkyzphp)

The file `config/monkyz.php` contains the configuration details of **Monkyz**:

- `prefix`: prefix of url for access at **Monkyz**
- `use_https` (true|false): force chema https
- `use_auth` (true|false): laravel authentication, otherwise access to panel is automatically
- `cache_minutes`: minutes of duration of cache
- `path_public_temp`: folder name, in `public` path, for temporary files
- `vendors`: array for define [vendors assets](#vendors) version

### File `monkyz-tables.php`

[](#file-monkyz-tablesphp)

The file `config/monkyz-tables.php` contains parameters for generate the dynamic configuration of the DB structure:

- `input_from_type`: array to find the relative input according to the field type defined on the database
- `input_from_name`: array to find the relative input according to the name of field
- `fields_name_hide_in_edit`: array of field's name that will be hidden in edit (such as: created\_at, updated\_at, deleted\_at)
- `tables`: [view the details](#parameter-tables)

This file can be automatically generated with the [artisan command `monkyz:generate-db`](#artisan-commands)

#### Parameter `tables`

[](#parameter-tables)

The `tables` parameter are the ovveride array of dynamic DB structure:

```
'table_name'	=> [	// name of table in db
	'title'	=> 'Table',
	'icon'	=> 'fa fa-table fa-fw',
	'visible'	=> true,
  'ajax_list' => false,
	'fields'	=> [
		'field_name'	=> [	// name of field in db
			'title'	=> 'Column',
      'input' => 'text',
			'order'	=> 'asc',
			'in_list'	=> true,
			'in_edit'	=> true,
			'enum'	=> [
				'attr'	=> 'value'
			]
			'file'	=> [
				'disk'	=> 'local',
				'path'	=> 'uploads/',
				'overwrite'	=> true,
				'resize'	=> false,
				'resize_height_px'	=> 1000,
				'resize_width_px'	=> 1000,
			],
			'relation'	=> [
				'table'	=> 'table2',
				'field_value'	=> 'id',
				'field_text'	=> 'name',
			],
			'attributes'	=> [
				'attr'	=> 'value'
			]
		]
	]
],
```

##### Table parameters

[](#table-parameters)

- `title`: title of table
- `icon`: the [fontawesome icon](http://fontawesome.io/icons/)
- `visible` (true|false): visibility of table in the sidebar menù
- `ajax_list` (true|false): defines whether to activate the ajax paging and filtering
- `fields`: list of fields in table

##### Fields parameters

[](#fields-parameters)

- `title`: title of column
- `input`: The values for this parameter are:
    - `block`: the `` block to display formatted text
    - `checkbox`: checkbox true/false
    - `color`: hex color selector (for details see: [W3C HTML Forms](http://www.w3schools.com/html/html_forms.asp))
    - `date`: only date tag (for details see: [W3C HTML Forms](http://www.w3schools.com/html/html_forms.asp))
    - `datetime`: date and time (for details see: [W3C HTML Forms](http://www.w3schools.com/html/html_forms.asp))
    - `editor`: a simple wysiwyg editor (used [Bootstrap3 Wysiwyg](https://bootstrap-wysiwyg.github.io/bootstrap3-wysiwyg/))
    - `enum`: select box for enum (mandatory to define the parameter `enum`)
    - `file`: file upload (mandatory to define the parameter `file`)
    - `hidden`: field hidden used, by default, to the key fields
    - `image`: file upload for only image (accepted extensions: .jpg, .jpeg, .png) (mandatory to define the parameter `file`)
    - `number`: number tag (for details see: [W3C HTML Forms](http://www.w3schools.com/html/html_forms.asp))
    - `relation`: select box with the relation with another table (mandatory to define the parameter `relation`)
    - `tel`: telephone number (for details see: [W3C HTML Forms](http://www.w3schools.com/html/html_forms.asp))
    - `text`: text tag for string
    - `textarea`: textarea tag
    - `url`: url tag (for details see: [W3C HTML Forms](http://www.w3schools.com/html/html_forms.asp))
    - (You can create [your own custom fields](#custom-fields))
- `order`: (null|asc|desc) defines the default table sorting
- `in_list` (true|false): visibility in list
- `in_edit` (true|false): visibility in edit and add record
- `enum`: array `'key' => 'value'` for populate the select box
- `file`: file/image field details
    - `disk`: disk name for `Storage` class, configured in config files `filesystems.php` (for more info see [Laravel Filesystem Documentation](https://laravel.com/docs/5.2/filesystem)). If no one is indicated, it takes the default disk.
    - `path`: relative path of images uploaded
    - `overwrite` (true|false): overwrite the file if it already exists
    - `resize` (true|false): if field is a image, determines if the uploaded image will be resized
    - `resize_height_px`: pixel in height for resize image
    - `resize_width_px`: pixel in width for resize image
- `relation`: relationship field details
    - `table`: name of relationship's table
    - `field_value`: name of value field of relationship's table
    - `field_text`: name of text field of relationship's table
- `attributes`: array (`'key' => 'value'`) of extra attributes in input

In automatically search for the type of the field input, it is to be more important to the `input_from_name` parameter rather than a `input_from_type`.

> **!!! ATTENTION !!!****Monkyz** currently only supports one-to-one and many-to-one relationships. All tables of many-to-many relationship will have to be defined in [config file `monkyz-tables.php`](#table-parameters) and setting the parameter `visible` to `false`.

Authentication
--------------

[](#authentication)

You can decide whether or not to use authentication to access the administration panel. You can define it with `use_auth` parameter in the configuration [file `monkyz.php`](#file-monkyzphp).

If `use_auth` parameters is `true`, **Monkyz** uses [Laravel authentication](https://laravel.com/docs/5.2/authentication). If you want to use auth, you can run artisan command `php artisan make:auth`.

Otherwise, if `use_auth` is `false`, the access to **Monkyz** is automatic.

Artisan Commands
----------------

[](#artisan-commands)

### `monkyz:tables`

[](#monkyztables)

**Monkyz** provides the artisan command:

```
php artisan monkyz:tables
```

This command allows you to automatically fill in the [`monkyz-tables.php` config file](#file-monkyz-tablesphp).

It will automatically create all the necessary references to **Monkyz** for the db structure. Not overwrite already entered parameters: only add the parameters have not been set.

Customize
---------

[](#customize)

### Custom Fields

[](#custom-fields)

**Monkyz** allows the creation of types of custom fields in the edit page of the record.

To create it, follow these steps:

1. If you have not already done so, to publish the views:

```
php artisan vendor:publish --provider="Lab1353\Monkyz\Providers\MonkyzServiceProvider"
```

The following command will be published the views files in: `/resources/views/vendor/monkyz`

2. Go to the `resources/views/vendor/monkyz/` folder and create a new [file blade](https://www.laravel.com/docs/5.2/blade), appointing him as your new field (for example: `custom`):

```
cd resources/views/vendor/monkyz
touch custom.blade.php
```

You can add css references using the section `css`:

```
@section('css')
  @parent

@endsection

```

or js with the section `scripts`:

```
@section('scripts')
  @parent

@endsection

```

3. Edit the new file as you prefer. Know that, the view, the following variables are passed:

- `$field`: name of database column
- `$record`: the [Eloquent Model](https://www.laravel.com/docs/5.2/eloquent) (to retrieve the value of the field then use: `$record->$field`)
- `$params`: array of field parameters

4. Now you can use your personal type of field, setting the parameter of the `input` fields:

```
'table_name'	=> [	// name of table in db
	'fields'	=> [
		'field_name'	=> [	// name of field in db
			'input'	=> 'custom',	//
