omatech / editora-laravel-connector-dbinterface
该包最新版本(v3.1.0)没有可用的许可证信息。
v3.1.0
2024-06-07 11:20 UTC
Requires
- dev-master
- v3.1.0
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0
- v2.2.1
- v2.2.0
- v2.1.0
- v2.0.16
- v2.0.15
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0
- dev-compatibility-functions-new-laravel
- dev-compatibility-laravel-11
- dev-new-date-filter
- dev-develop
This package is auto-updated.
Last update: 2024-09-07 12:00:35 UTC
README
Laravel 设置
创建新的 Laravel 空项目
composer create-project --prefer-dist laravel/laravel editora-test
设置 .env 文件,包括数据库连接等
在 composer.json 文件中,在文件根目录添加稳定性设置,并更改项目和描述的名称,例如
"name": "editora-test",
"description": "Editora Frontend",
"minimum-stability": "dev",
"prefer-stable": true,
执行 composer update
composer update
发布新的供应商,运行
php artisan vendor:publish --provider=Omatech\Editora\Connector\ConnectorServiceProvider
将所有标记资产放入 resources/assets/markup 中(scss、js、img、fonts 等)
在根目录的 webpack.mix.js 中覆盖 mix.js 调用
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/markup/scss/styles.scss', 'public/css/styles.css')
.copy('resources/assets/markup/js', 'public/js')
.copy('resources/assets/markup/img', 'public/img')
.copy('resources/assets/markup/fonts', 'public/fonts')
.version();
安装并运行 npm
npm install
npm run dev
在 routes/web.php 中添加 editora 路由
use Omatech\Editora\Connector\Editora;
Editora::routes();
在 config 文件夹中有两个文件用于 editora 设置:editora.php 设置语言和不同的 editora 选项,editoradatabase.php 设置 editora 结构
修改 editoradatabase.php 并运行以应用更改
php artisan editora:create
为 editora 生成假内容
php artisan editora:fakecontent --delete_previous_data
为当前 Editora 结构创建 MVC 结构
php artisan editora:createmvc
将 editora_admin 复制到另一个文件夹中,例如 editora-test-admin
cd .. (to your www root folder)
mkdir editora-test-admin
cd editora-test-admin
git clone https://aponsoma@bitbucket.org/omatechteam/editora_admin.git .
在 ompinfo.php 中复制配置并更改数据库和文件夹以及 URL 设置(查找 # 字符以查看需要更改的内容)
cd conf
cp ompinfo_sample.php ompinfo.php
双重检查 HASHED_PASSWORDS,必须为 1
更改您的虚拟主机以包括 admin 目录并重启 Apache,例如
<VirtualHost *:80>
DocumentRoot "/var/www/editora-test/public"
ServerName editoratest.localhost
<Directory "/var/www/editora-test/public">
Allow from all
Require all granted
AllowOverride All
</Directory>
Alias /admin "/var/www/editora-test-admin"
<Directory "/var/www/editora-test-admin">
AllowOverride All
Allow from all
Require all granted
</Directory>
</VirtualHost>
Laravel 命令
生成器
根据 config/editoradatabase.php 中设置的规则创建 Editora 数据库结构
php artisan editora:create
假内容
为 Editora 数据库创建随机内容。
php artisan editora:fakecontent
参数
php artisan editora:fakecontent --exclude_classes=1,10,11,12,13
{--num_instances=} {--include_classes=} {--exclude_classes=} {--pictures_theme=} {—debug} {--delete_previous_data}
--num_instances number of instance to create for each class
--include_classes generate only this class_ids, comma separated
--exclude_classes generate all but this class_ids, comma separated
--pictures_theme generate pictures themed with that word, default:cats you can use abstract, animals, business, cats, city, food, nightlife, fashion, people, nature, sports, technics, transport
--debug show all sqls (if not present false)
--delete_previous_data **USE WITH CAUTION**, if set deletes all the previous data before generating the fake data
待定 需要为一些属性(地图、日期等)添加随机内容。
创建 MVC
为前端创建模型、视图和控制器文件(如果不存在)
php artisan editora:createmvc
--include_classes generate only this class_ids, comma separated
--exclude_classes generate all but this class_ids, comma separated
--old_school_controllers allow generation of old_school_controllers instead of new ones
参数
--include_classes=1,2,3 generate only this class_ids, comma separated
--force_overwrite_views
--force_overwrite_models
--force_overwrite_controllers
--force_overwrite_all
待定 需要创建强制参数以删除类。
现代化
改进 editora 数据库的数据库结构,仅用于旧版 editora,不用于新项目。它创建索引、添加了最近的新列,如 batch_id、external_id,并更改使用加密密码
php artisan editora:modernize