2017 © Pedro Peláez
 

library laravel-translatable-bootforms

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

image

baklysystems/laravel-translatable-bootforms

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  • Wednesday, November 22, 2017
  • by elbakly
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 31 Versions
  • 0 % Grown

The README.md

Laravel Translatable BootForms

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads License, (*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, (*4)

    composer require propaganistas/laravel-translatable-bootforms
    
  2. In your app config, add the Service Provider in the $providers array after BootFormsServiceProvider and TranslatableServiceProvider, (*5)

    'providers' => [
        AdamWathan\BootForms\BootFormsServiceProvider::class,
        Dimsav\Translatable\TranslatableServiceProvider::class,
        ...
        Propaganistas\LaravelTranslatableBootForms\TranslatableBootFormsServiceProvider::class,
    ],
    
  3. In your app config, add the Facade to the $aliases array, (*6)

    'aliases' => [
        ...
        'TranslatableBootForm' => Propaganistas\LaravelTranslatableBootForms\Facades\TranslatableBootForm::class,
    ],
    
  4. Publish the configuration file, (*7)

    php artisan vendor:publish --provider="Propaganistas\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., (*8)

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

Example:, (*10)

// 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., (*11)

{!! 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:, (*12)

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:, (*13)

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

In case you need to construct name attributes other than en[name], e.g. item.en.name, manually insert the %locale placeholder in your name attribute. Note that model binding will break for these inputs., (*14)

TranslatableBootForm::text('Name','item.%locale.name')

// Output


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

The Versions

22/11 2017

dev-master

9999999-dev

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas
by BaklySystems

laravel form i18n translatable bootforms

22/11 2017

1.4.2

1.4.2.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas
by BaklySystems

laravel form i18n translatable bootforms

20/11 2017

1.4

1.4.0.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas
by BaklySystems

laravel form i18n translatable bootforms

20/11 2017

dev-dev-spatie-translatable

dev-dev-spatie-translatable

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

04/10 2017

1.3.12

1.3.12.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/09 2017

1.3.11

1.3.11.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/07 2017

1.3.10

1.3.10.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

29/06 2017

1.3.9

1.3.9.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/02 2017

dev-travis-update

dev-travis-update

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

30/01 2017

1.3.8

1.3.8.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

29/01 2017

1.3.7

1.3.7.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

05/01 2017

1.3.6

1.3.6.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

05/01 2017

dev-dev-custom-name-attribute

dev-dev-custom-name-attribute

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

21/12 2016

dev-dev-callable-argument

dev-dev-callable-argument

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

21/09 2016

1.3.5

1.3.5.0

Empowers adamwathan/bootforms with dimsav/laravel-translatable.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Propaganistas

laravel form i18n translatable bootforms

05/09 2016

1.3.4

1.3.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

26/04 2016

1.3.3

1.3.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

01/04 2016

1.3.2

1.3.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

24/03 2016

1.3.1

1.3.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

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