Configuration
After the installation is complete, two configuration files are generated for configuring the management background, config/admin.php
and app/Admin/bootstrap.php
config/admin.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Open-Admin name
|--------------------------------------------------------------------------
|
| This value is the name of Open-Admin, This setting is displayed on the
| login page.
|
*/
'name' => 'Open-Admin',
/*
|--------------------------------------------------------------------------
| Open-Admin logo
|--------------------------------------------------------------------------
|
| The logo of all admin pages. You can also set it as an image by using a
| `img` tag, eg '<img src="http://logo-url" alt="Admin logo">'.
|
*/
'logo' => '<b>Open</b> admin',
/*
|--------------------------------------------------------------------------
| Open-Admin mini logo
|--------------------------------------------------------------------------
|
| The logo of all admin pages when the sidebar menu is collapsed. You can
| also set it as an image by using a `img` tag, eg
| '<img src="http://logo-url" alt="Admin logo">'.
|
*/
'logo-mini' => '<b>OA</b>',
/*
|--------------------------------------------------------------------------
| Open-Admin bootstrap setting
|--------------------------------------------------------------------------
|
| This value is the path of Open-Admin bootstrap file.
|
*/
'bootstrap' => app_path('Admin/bootstrap.php'),
/*
|--------------------------------------------------------------------------
| Open-Admin route settings
|--------------------------------------------------------------------------
|
| The routing configuration of the admin page, including the path prefix,
| the controller namespace, and the default middleware. If you want to
| access through the root path, just set the prefix to empty string.
|
*/
'route' => [
'prefix' => env('ADMIN_ROUTE_PREFIX', 'admin'),
'namespace' => 'App\\Admin\\Controllers',
'middleware' => ['web', 'admin'],
],
/*
|--------------------------------------------------------------------------
| Open-Admin install directory
|--------------------------------------------------------------------------
|
| The installation directory of the controller and routing configuration
| files of the administration page. The default is `app/Admin`, which must
| be set before running `artisan admin::install` to take effect.
|
*/
'directory' => app_path('Admin'),
/*
|--------------------------------------------------------------------------
| Open-Admin html title
|--------------------------------------------------------------------------
|
| Html title for all pages.
|
*/
'title' => 'Admin',
/*
|--------------------------------------------------------------------------
| Access via `https`
|--------------------------------------------------------------------------
|
| If your page is going to be accessed via https, set it to `true`.
|
*/
'https' => env('ADMIN_HTTPS', false),
/*
|--------------------------------------------------------------------------
| Open-Admin auth setting
|--------------------------------------------------------------------------
|
| Authentication settings for all admin pages. Include an authentication
| guard and a user provider setting of authentication driver.
|
| You can specify a controller for `login` `logout` and other auth routes.
|
*/
'auth' => [
'controller' => App\Admin\Controllers\AuthController::class,
'guards' => [
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
],
'providers' => [
'admin' => [
'driver' => 'eloquent',
'model' => OpenAdmin\Admin\Auth\Database\Administrator::class,
],
],
// Add "remember me" to login form
'remember' => true,
// Redirect to the specified URI when user is not authorized.
'redirect_to' => 'auth/login',
// The URIs that should be excluded from authorization.
'excepts' => [
'auth/login',
'auth/logout',
],
],
/*
|--------------------------------------------------------------------------
| Open-Admin upload setting
|--------------------------------------------------------------------------
|
| File system configuration for form upload files and images, including
| disk and upload path.
|
*/
'upload' => [
// Disk in `config/filesystem.php`.
'disk' => 'admin',
// Image and file upload path under the disk above.
'directory' => [
'image' => 'images',
'file' => 'files',
],
],
/*
|--------------------------------------------------------------------------
| Open-Admin database settings
|--------------------------------------------------------------------------
|
| Here are database settings for Open-Admin builtin model & tables.
|
*/
'database' => [
// Database connection for following tables.
'connection' => '',
// User tables and model.
'users_table' => 'admin_users',
'users_model' => OpenAdmin\Admin\Auth\Database\Administrator::class,
// Role table and model.
'roles_table' => 'admin_roles',
'roles_model' => OpenAdmin\Admin\Auth\Database\Role::class,
// Permission table and model.
'permissions_table' => 'admin_permissions',
'permissions_model' => OpenAdmin\Admin\Auth\Database\Permission::class,
// Menu table and model.
'menu_table' => 'admin_menu',
'menu_model' => OpenAdmin\Admin\Auth\Database\Menu::class,
// Pivot table for table above.
'operation_log_table' => 'admin_operation_log',
'user_permissions_table' => 'admin_user_permissions',
'role_users_table' => 'admin_role_users',
'role_permissions_table' => 'admin_role_permissions',
'role_menu_table' => 'admin_role_menu',
],
/*
|--------------------------------------------------------------------------
| User operation log setting
|--------------------------------------------------------------------------
|
| By setting this option to open or close operation log in Open-Admin.
|
*/
'operation_log' => [
'enable' => true,
/*
* Only logging allowed methods in the list
*/
'allowed_methods' => ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
/*
* Routes that will not log to database.
*
* All method to path like: admin/auth/logs
* or specific method to path like: get:admin/auth/logs.
*/
'except' => [
'admin/auth/logs*',
],
],
/*
|--------------------------------------------------------------------------
| User default avatar
|--------------------------------------------------------------------------
|
| Set a default avatar for newly created users.
|
*/
'default_avatar' => '/vendor/Open-Admin/AdminLTE/dist/img/user2-160x160.jpg',
/*
|--------------------------------------------------------------------------
| Admin map field provider
|--------------------------------------------------------------------------
|
| Supported: "tencent", "google", "yandex".
|
*/
'map_provider' => 'google',
/*
|--------------------------------------------------------------------------
| Application Skin
|--------------------------------------------------------------------------
|
| This value is the skin of admin pages.
| @see https://adminlte.io/docs/2.4/layout
|
| Supported:
| "skin-blue", "skin-blue-light", "skin-yellow", "skin-yellow-light",
| "skin-green", "skin-green-light", "skin-purple", "skin-purple-light",
| "skin-red", "skin-red-light", "skin-black", "skin-black-light".
|
*/
'skin' => 'skin-blue-light',
/*
|--------------------------------------------------------------------------
| Application layout
|--------------------------------------------------------------------------
|
| This value is the layout of admin pages.
| @see https://adminlte.io/docs/2.4/layout
|
| Supported: "fixed", "layout-boxed", "layout-top-nav", "sidebar-collapse",
| "sidebar-mini".
|
*/
'layout' => ['sidebar-mini', 'sidebar-collapse'],
/*
|--------------------------------------------------------------------------
| Login page background image
|--------------------------------------------------------------------------
|
| This value is used to set the background image of login page.
|
*/
'login_background_image' => '',
/*
|--------------------------------------------------------------------------
| Show version at footer
|--------------------------------------------------------------------------
|
| Whether to display the version number of Open-Admin at the footer of
| each page
|
*/
'show_version' => true,
/*
|--------------------------------------------------------------------------
| Show environment at footer
|--------------------------------------------------------------------------
|
| Whether to display the environment at the footer of each page
|
*/
'show_environment' => true,
/*
|--------------------------------------------------------------------------
| Menu bind to permission
|--------------------------------------------------------------------------
|
| whether enable menu bind to a permission
*/
'menu_bind_permission' => true,
/*
|--------------------------------------------------------------------------
| Indicates whether to check route permission.
|--------------------------------------------------------------------------
*/
'check_route_permission' => true,
/*
|--------------------------------------------------------------------------
| Indicates whether to check menu roles.
|--------------------------------------------------------------------------
*/
'check_menu_roles' => true,
/*
|--------------------------------------------------------------------------
| Enable default breadcrumb
|--------------------------------------------------------------------------
|
| Whether enable default breadcrumb for every page content.
*/
'enable_default_breadcrumb' => true,
/*
|--------------------------------------------------------------------------
| Enable/Disable assets minify
|--------------------------------------------------------------------------
*/
'minify_assets' => [
// Assets will not be minified.
'excepts' => [
],
],
/*
|--------------------------------------------------------------------------
| Enable/Disable sidebar menu search
|--------------------------------------------------------------------------
*/
'enable_menu_search' => true,
/*
|--------------------------------------------------------------------------
| Alert message that will displayed on top of the page.
|--------------------------------------------------------------------------
*/
'top_alert' => '',
/*
|--------------------------------------------------------------------------
| The global Grid action display class.
|--------------------------------------------------------------------------
*/
'grid_action_class' => \OpenAdmin\Admin\Grid\Displayers\DropdownActions::class,
/*
|--------------------------------------------------------------------------
| Extension Directory
|--------------------------------------------------------------------------
|
| When you use command `php artisan admin:extend` to generate extensions,
| the extension files will be generated in this directory.
*/
'extension_dir' => app_path('Admin/Extensions'),
/*
|--------------------------------------------------------------------------
| Settings for extensions.
|--------------------------------------------------------------------------
|
| You can find all available extensions here
| https://github.com/Open-Admin-extensions.
|
*/
'extensions' => [
],
];
app/Admin/bootstrap.php
In this file you can extend or remove your components or introduce front-end resources
<?php
/**
* Open-Admin - admin builder based on Laravel.
* @author z-song <https://github.com/z-song>
*
* Bootstraper for Admin.
*
* Here you can remove builtin form field:
* OpenAdmin\Admin\Form::forget(['map', 'editor']);
*
* Or extend custom form field:
* OpenAdmin\Admin\Form::extend('php', PHPEditor::class);
*
* Or require js and css assets:
* Admin::css('/packages/prettydocs/css/styles.css');
* Admin::js('/packages/prettydocs/js/main.js');
*
*/
OpenAdmin\Admin\Form::forget(['map', 'editor']);