typicms/translatablebootforms

用于翻译字段表单模型绑定,使用 BootForms 和 Translatable。

v2.3.0 2015-12-25 14:40 UTC

This package is auto-updated.

Last update: 2024-08-29 03:35:48 UTC


README

此包将可能被 TypiCMS 下一个版本弃用,并可能使用 Laravel-Translatable-Bootforms

TranslatableBootForms 是基于 BootFormsLaravel Translatable 构建的 Laravel 包,它允许在翻译字段上进行表单模型绑定。

使用 Composer 安装

您可以使用以下命令通过 Composer 安装此包

composer require typicms/translatablebootforms

Laravel 中的安装

修改 config/app.php 中的 providers 数组以包含服务提供者

'providers' => [
    //…
    TypiCMS\TranslatableBootForms\TranslatableBootFormsServiceProvider::class,
],

运行 composer update

BootFormTranslatable 门面添加到 config/app.php 中的 aliases 数组

'aliases' => [
    //…
    'BootForm' => AdamWathan\BootForms\Facades\BootForm::class,
    'Translatable' => Dimsav\Translatable\Translatable::class,
],

您现在可以通过直接在 BootForm 门面上调用方法来开始使用 BootForms

BootForm::text('title', 'en[title]')

文档

BootForms
https://github.com/adamwathan/bootforms
Laravel-Translatable
https://github.com/dimsav/laravel-translatable