dedermus / open-admin-core
open-admin-core. 开源 Laravel 管理面板。无专业或付费包,免费且开源。基于 laravel-admin,特别感谢 z-song
Requires
- php: ^8.2
- doctrine/dbal: ^4.1
- laravel/framework: >=7.0
- symfony/dom-crawler: ~3.1|~4.0|~5.0
Requires (Dev)
- fzaninotto/faker: ~1.4
- intervention/image: ~2.3
- laravel/browser-kit-testing: ^6.0
- laravel/laravel: ^11
- spatie/phpunit-watcher: ^1.22.0
Suggests
- intervention/image: Required to handling and manipulation upload images (~2.3).
- spatie/eloquent-sortable: Required to built orderable gird.
This package is not auto-updated.
Last update: 2024-10-02 18:17:31 UTC
README
⛵laravel-admin
是一个用于 laravel 的管理界面构建器,它可以帮助您仅用几行代码就创建 CRUD 功能。
该构建器是从项目 https://github.com/open-admin-org/open-admin 分支出来的。
灵感来源于项目 SleepingOwlAdmin、rapyd-laravel 和 laravel-admin。
要求
- PHP ^8.2
- Laravel >= ^11.9
- Fileinfo PHP 扩展
安装
首先安装 laravel 11 或更高版本,并确保数据库连接设置正确。
拉取框架骨架
composer create-project laravel/laravel example-app
在 config/app.php 中设置本地化和其他参数
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', null),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'Europe/Moscow',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'ru',
php artisan storage:link
创建名为 new 的数据库(或根据开发者意愿命名)
在 .env 中设置数据库连接(以下是开发环境示例设置)
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=new_base
DB_USERNAME=postgres
DB_PASSWORD=postgres
然后安装管理面板
composer require dedermus/open-admin-core
然后运行以下命令以发布资源和配置
php artisan vendor:publish --provider="OpenAdminCore\Admin\AdminServiceProvider"
运行命令后,您可以在 config/admin.php 文件中找到配置文件,在此文件中您可以更改安装目录、数据库连接或表名。同时,在 config/filesystems.php 文件中,在 disks 部分添加权限
'disks' => [
...
'uploads' => [
'driver' => 'local',
'root' => public_path('uploads'),
'url' => env('APP_URL').'/uploads',
'visibility' => 'public',
],
'admin' => [
'driver' => 'local',
'root' => public_path('uploads'),
'url' => env('APP_URL').'/uploads',
'visibility' => 'public',
],
...
启用 HTTPS 支持
/*
|--------------------------------------------------------------------------
| Access via `https`
|--------------------------------------------------------------------------
|
| If your page is going to be accessed via https, set it to `true`.
|
*/
'https' => env('ADMIN_HTTPS', true),
最后,执行以下命令以完成安装。
php artisan admin:install
在浏览器中打开 https:///admin/
,使用用户名 admin
和密码 admin
登录。
配置
config/admin.php 文件包含配置数组,您可以在其中找到默认配置。
更新
更新到 open-admin 的新版本可能需要更新资源,您可以使用以下命令发布
php artisan vendor:publish --tag=open-admin-assets --force
支持从右到左
按照此路径 <YOUR_PROJECT_PATH>\vendor\dedermus\open-admin-core\src\Traits\HasAssets.php
修改 $baseCss
数组以加载从右到左 (rtl) 版本的启动加载和 CSS 文件 AdminLTE。
bootstrap.min.css 更改为 bootstrap.rtl.min.css
AdminLTE.min.css 更改为 AdminLTE.rtl.min.css
来自 Zong 的扩展
针对 Bootstrap 5.3 重构的 Open-Admin 扩展
作者
该项目得益于所有贡献者。 [贡献]
赞助者
感谢所有赞助者!🙏 [成为赞助者]
赞助商
通过成为赞助商来支持此项目。您的标志将在这里显示,并附有指向您网站的链接。[成为赞助商]
其他
laravel-admin
基于以下插件或服务
- Laravel
- AdminLTE
- Datetimepicker
- font-awesome
- moment
- Google map
- Tencent map
- bootstrap-fileinput
- jquery-pjax
- Nestable
- toastr
- X-editable
- bootstrap-number-input
- fontawesome-iconpicker
- sweetalert2
许可证
laravel-admin
使用 MIT 许可协议 (MIT) 许可。