2017 © Pedro PelĂĄez
 

library laravel-translatable-bootforms

Empowers typicms/bootforms with spatie/laravel-translatable.

image

typicms/laravel-translatable-bootforms

Empowers typicms/bootforms with spatie/laravel-translatable.

  • Wednesday, May 9, 2018
  • by sdebacker@gmail.com
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,694 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 17 Versions
  • 26 % Grown

The README.md

Laravel Translatable BootForms

Actions Status Coverage Status, (*1)

Make BootForms work flawlessly with Laravel Translatable!, (*2)

By importing this package, generating translatable forms using BootForms is a breeze., (*3)

Installation

  1. Run the Composer require command to install the package, the service provider will be autodiscovered by Laravel., (*4)

    composer require typicms/laravel-translatable-bootforms
    
  2. In your app config, add the Facade to the $aliases array, (*5)

    'aliases' => [
       ...
       'TranslatableBootForm' => TypiCMS\LaravelTranslatableBootForms\Facades\TranslatableBootForm::class,
    ],
    
  3. Publish the configuration file, (*6)

    php artisan vendor:publish --provider="TypiCMS\LaravelTranslatableBootForms\TranslatableBootFormsServiceProvider" --tag="config"
    

Usage

Simply use the TranslatableBootForm Facade as if it were BootForm! That’s it. Multiple form inputs will now be generated for the locales set in Translatable’s configuration file. They will have the corresponding value for each language and will save all of the translations without any code manipulation., (*7)

Please review BootForms’ documentation if you’re unsure how to use it., (*8)

Example:, (*9)

// View
{!! BootForm::text('Name', 'name')
            ->placeholder('My placeholder') !!}

// Output


// Controller public function postEdit($request) { $someModel->save($request->all()); }
// View
{!! TranslatableBootForm::text('Name', 'name')
                        ->placeholder('My placeholder') !!}

// Output


// Controller public function postEdit($request) { $someModel->save($request->all()); }

You can use the %name and %locale placeholders while specifying parameters. The placeholder will be replaced with the corresponding input name or locale. This can be useful for two-way data binding libraries such as Angular.js or Vue.js. E.g., (*10)

{!! TranslatableBootForm::text('Title', 'title')
                        ->attribute('some-attribute', 'Name: %name')
                        ->attribute('another-attribute', 'Locale: %locale') !!}

// Output


To render a form element only for some chosen locales, explicitly call renderLocale() as the final method and pass the locale or an array of locales as the first parameter:, (*11)

TranslatableBootForm::text('Name', 'name')
                    ->renderLocale('en')

If you need to apply a method only for certain locales, suffix the method with ForLocale and pass the locale or an array of locales as the first parameter:, (*12)

TranslatableBootForm::text('Name', 'name')
                    ->dataForLocale('en', 'attributeName', 'attributeValue')
                    ->addClassForLocale(['en', 'nl'], 'addedClass')

For customizing the locale indicator in the label (and several other settings), please take a look at the configuration file., (*13)

The Versions

09/05 2018

dev-master

9999999-dev

Empowers typicms/bootforms with spatie/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

09/05 2018

2.0.0

2.0.0.0

Empowers typicms/bootforms with spatie/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

09/05 2018

dev-analysis-8nGaEA

dev-analysis-8nGaEA

Empowers typicms/bootforms with spatie/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

09/05 2018

dev-analysis-zYdBEo

dev-analysis-zYdBEo

Empowers typicms/bootforms with spatie/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

17/08 2017

1.4.0

1.4.0.0

Empowers adamwathan/bootforms with spatie/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

20/03 2016

1.3.0

1.3.0.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

15/03 2016

1.2.2

1.2.2.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

15/03 2016

1.2.1

1.2.1.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

23/02 2016

1.2.0

1.2.0.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

20/01 2016

1.1.4

1.1.4.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

03/01 2016

1.1.3

1.1.3.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

03/01 2016

1.1.2

1.1.2.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

02/01 2016

1.1.1

1.1.1.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

10/12 2015

1.1.0

1.1.0.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

09/12 2015

1.0.2

1.0.2.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

04/12 2015

1.0.1

1.0.1.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

03/12 2015

1.0.0

1.0.0.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

by Avatar Propaganistas

laravel form i18n translatable bootforms