windfallinc/woodpecker

这是一个用于各种物品的包

1.145 2020-08-05 07:26 UTC

README

alt text

Woodpecker

Windfall laravel应用程序的内容管理系统。

自动创建管理面板、数据库、表单逻辑(带有不可见验证码)和页面逻辑。

安装

使用composer安装此包

composer require windfallinc/woodpecker

包自动发现。

发布woodpecker资源,并迁移数据库

php artisan vendor:publish --tag=woodpecker --force

php artisan migrate

如果您遇到迁移问题,请参阅 https://news.laravel.net.cn/laravel-5-4-key-too-long-error

搞定!一切正常!

视图中的examples包括示例模板。在composer.json中包含可选的辅助函数

"autoload": {
"files": [
            "app/Http/Controllers/woodpecker-helpers.php"
        ],

如果您正在使用Orca和Woodpecker,确保您的laravel mix文件看起来类似于

const mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/js/app.js', 'public/js')
   .less('resources/assets/less/app.less', 'public/css')
   .less('resources/assets/less//woodpecker/admin.less', 'public/css/woodpecker');

设置.env captcha以启用表单

NOCAPTCHA_SECRET=<Your Secret Key>
NOCAPTCHA_SITEKEY=<Your Site Key>

自定义

创建新模板

在views/templates/example-slug.blade.php中创建模板

将新创建的模板添加到数据库表'templates'中

该模板现在将出现在后端,可供任何数据类型使用。

特色图片

$page->featimg()

标题

$page->title

内容

@include('dashboard.includes.body')

任何自定义字段

$page->get_the('field name')

元描述

$page->metadesc

元关键词

$page->keywords

创建新组件

Views->components包含所有前端组件代码。

Views->dashboard->components包含所有后端组件代码。

在数据库中添加一个新的'component'并将其'type'设置为模板。

编辑Woodpeckers admin.less文件以包含您的组件CSS。例如:@import "../components/homepage-slider.less";

自定义路由

web.php文件中的任何路由都可以覆盖Woodpeckers路由。确保它们有名称并指向您自己的自定义控制器

Route::get('/anything', 'WebsiteController@index')->name('anything');

更新

在您的composer update之后,为了完成您的升级

php artisan vendor:publish --tag=woodpeckerupdate --force

支持

Laravel 5.5及以上。