Package Data | |
---|---|
Maintainer Username: | kluvi |
Maintainer Contact: | kluvanek@gmail.com (Jakub Kluvánek) |
Package Create Date: | 2017-07-03 |
Package Last Update: | 2019-11-02 |
Language: | PHP |
License: | WTFPL |
Last Refreshed: | 2025-02-06 03:07:08 |
Package Statistics | |
---|---|
Total Downloads: | 90 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Adminer Admin is ultimative administration for any database. It is based on top of Adminer Editor from Jakub Vrána. Adminer Admin is available in many languages (same as Adminer Editor).
Adminer Admin is intended for your customers (when you makes some simple website for them) to edit content on their websites.
You:
Your customer:
composer require kluvi/adminer-admin
\kluvi\AdminerAdmin\Base\AdminerAdminServiceProvider::class,
in config/app.php
app/Http/Middleware/VerifyCsrfToken.php
middleware and add '/adminer-admin*'
to $except
array (or your custom route from config/adminer-admin.php
)php artisan vendor:publish --provider="kluvi\AdminerAdmin\Base\ServiceProvider" --tag=migrations
, which publishes migrationsphp artisan vendor:publish --provider="kluvi\AdminerAdmin\Base\ServiceProvider" --tag=config
, which publishes config files (it is needed when you want to change default image uploads location)php artisan migrate
Before first use, you must define comments in database (to tables and columns). Comments must be valid JSONs.
If table or column should be displayed, it must have at least {"name": "Column name"}
. Other tables and columns are not displayed.
Most of columns are displayed as <input type="text" />
. Some columns are different type, depending of default behaviour of Adminer Editor. Adminer Admin has some other types:
{"type": "image"}
- allows upload image file and displays this image. It currently does not makes thumbnails of uploaded images. You must pass baseDir
and baseUrl
which are used for storing and displaying images. Look into config/adminer-admin.php
for default values. Images are stored in directory {$baseDir}/{$tableName}/{$columnName}/{$primaryKeyValue}/{$uploadedFileName}
- so table must have some primary key. Images can be uploded after saving the record (it needs to have primaryKeyValue){"type": "multi-input"}
- allows storing multiple values as JSON array. Values are sortable and deletable. It's purpose is for storing for example product tags,...{"type": "password"}
- password column. It stores passed password as password_hash(){"type": "readonly"}
- this column is not editable. Just shows its value.Adminer Admin also overrides some default behaviour of Adminer Editor in this cases:
<select>
<select>
with names as {key column} - {column next to key column}
- it is more readable for users{"allowNew": false}
- disables creating new rows in this table{"allowDelete": false}
- disables deleting rows in this tableThere is also one special table adminer_help
. It has columns table
and text
. You can write some help text for your users there. This table is not directly viewable by users, but the content is rendered just after displaying table name.
Example database is placed in examples/dump.sql
. There is also index.php
which demonstrates usage without Laravel.
config/adminer-admin.php
AdminerFactory::run()
in your controllers to run Adminer Admin.<?php
require "./vendor/autoload.php";
$downloadUrl = 'https://github.com/vrana/adminer/releases/download/v4.3.1/editor-4.3.1-mysql.php';
$targetDir = './adminer-download';
// Uncomment this to download a copy of Adminer Editor from URL above an apply some patches to downloaded file
//$downloader = new \kluvi\AdminerAdmin\Base\Downloader;
//$downloader->download($downloadUrl, $targetDir);
$pluginsConfig = [
'field_image' => [
'baseDir' => './images/',
'baseUrl' => 'http://localhost/images/',
],
];
\kluvi\AdminerAdmin\Base\AdminerFactory::run($targetDir.'/adminer.php', $database = 'test', $host = 'localhost', $username = 'root', $password = '', $pluginsConfig);
If you miss some feature or needs some help, please create an Issue.