Download the PHP package makth/laravel-db-language without Composer
On this page you can find all versions of the php package makth/laravel-db-language. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download makth/laravel-db-language
More information about makth/laravel-db-language
Files in makth/laravel-db-language
Package laravel-db-language
Short Description Laravel command to add language fields on database
License MIT
Informations about the package laravel-db-language
Laravel DB Language
This package gives you an easy way to generate automatically all language fields on database, using Laravel 5 command. If you have on database fields like body_en
and you want to create new like body_it
you can use this package to create it.
Installing
First, pull in the package through Composer.
or
Next, open config/app.php
, and include service provider.
And, for convenience, add a facade alias to the same file at the bottom:
Usage
Add a language
Remove a language
Default language
You can set your default language using option --default
. For example:
If you want to have more than one languages, you set your main (already installed) language as default, and you add the other languages.
Config
You can publish config file lang.php
, and set your default language there.
Language Field
You can have form fields with multiple languages.
Step 1
Export css files to public folder.
Step 2
Add in your blade file, on head tag:
And at the bottom of the body:
And now you can get the form field with all installed languages like this:
table_name
: the name of the db table.field_name
: the name of table field, without language extension.- the third parameter is an array with languages values.
- the fourth parameter used to sets manual the default language.
- the fifth parameter is an array with extra attributes for the fields.
For form fields used twitter bootstrap, and for the flags this package.
Authors
- Makis Thomas
License
This project is licensed under the MIT License - see the LICENSE.md file for details.