Download the PHP package mosaiqo/translatable without Composer

On this page you can find all versions of the php package mosaiqo/translatable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package translatable

Mosaiqo Translatable


Latest Stable Version Total Downloads Latest Unstable Version License

This is a Laravel 5 package to have multi language models. It is prepared to use with MongoDB and Eloquent (it is planed to make it work also with MySQL).

This package was created to easily store the multi language models by embedsOne relations. Its a Plug & Play package, if you are using Laravel MondoDB.

Instalation


Install it via composer

Require it with composer :

or put it in your composer.json file

Add this to your config/app.php
Publish the config:

You can change the values, if you like.

Issues


Stories in Ready

We are still working on this package. It will be nice if you can get us some feedback.

If you find some errors or have an idea feel free to open a new issue .

Use it


Models

  1. You need to use the Mosaiqo\Translatable\Traits\Translatable in the models you want to have multi language ability.
  2. You also need to create a Translation model. The convention is to use the model's name for that you want to use with translatable and append Locale to it (You can override it in the config file).
  3. Optional you can specify the model to use for the translation, if not set it will search by default for a model with the current modelname and append Locale to it.
  4. Set the attributes you want to be translatable with protected $translatableAttributes.

The translation model should look similar to this. It is necesary to make the attributes fillable for the MassAsignment.

Documentation


Create a Multilanguage Model

It's very esay like with a normal model, the only difference is that you pass the translatable attributes inside an array and the key is the locale value.

There is an other method, you can first create the model and than assign it the translations.

Get the translations

Assuming you have a model stored in the DDBB.

This will output the attribute in the language you use, in this particular cas es() will return 'Mi titulo'.

And here 'My title'.

You also can assign it to a variable to use it later.

There is a more verbose mode if you like.

What if the translation doesn't exists, doesn't mather you can try with the default fallback language if the one you need is not available, just passing the second argument true.

Or you can use the alias for it

You can also set the fallback language for this particular call if you want to display it diferent.

You can know if a Model has a translation or not. This will return wheter true/false.

You can get the hole translations instance, it will return a collection of the ArticleLocale


All versions of translatable with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version ~5.0
jenssegers/mongodb Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mosaiqo/translatable contains the following files

Loading the files please wait ....