mbober35/helpers

开发用的特质和门面

1.4.6 2021-03-19 13:51 UTC

This package is auto-updated.

Last update: 2024-09-19 22:07:50 UTC


README

为了管理网站,您可以下载并添加主题 AdminKit,为它创建了菜单模板

安装

php artisan vendor:publish --provider="MBober35\Helpers\ServiceProvider" --tag=public
php artisan helpers:init

菜单

扩展配置 menu-structure,默认情况下其中包含两个变量 appadmin

变量

  • RE_CAPTCHA_SITE_KEY
  • RE_CAPTCHA_SECRET_KEY

特质

CopyStubs

一个针对包的特质,允许将 .stub 文件复制到应用程序中。需要指定复制文件的绝对路径以及复制到应用程序中的路径。

ShouldSlug

一个生成模型 slugs 的特质。默认情况下,slug 字段基于 title 字段。

CopyVue

一个针对包的特质,允许在发布后连接 vue 文件。

组件

x-re-captcha-check

输出 Google ReCaptcha 复选框。在 <head> 中必须有 @stack('js-lib')

参数

  • class: 按钮类
  • id: 按钮ID
  • no-script: 不添加 Google Api 脚本

x-re-captcha

输出用于发送带 Google ReCaptcha 保护表单的按钮。在 <head> 中必须有 @stack('js-lib')

参数

  • callback: 调用函数,在验证后将被调用
  • form-id: 表单ID,如果提供参数,则添加 js 函数
  • type: 按钮类型
  • class: 按钮类
  • id: 按钮ID
  • no-script: 不添加 Google Api 脚本

x-table-priority

输出用于更改输出优先级的元素列表

参数

  • table: 需要更改优先级的表
  • field(priority): 负责优先级的字段
  • elements: 元素数组

元素

  • name: 标题
  • id: ID
  • url(非必须): 如果指定,则标题将是链接

示例

<x-table-priority table="users" :elements="$users"></x-table-priority>

验证

ReCaptcha

Google ReCaptcha 验证