Download the PHP package mihkullorg/laravel-translatable without Composer

On this page you can find all versions of the php package mihkullorg/laravel-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 laravel-translatable

Laravel translatable

Latest Stable Version Total Downloads Build status StyleCI License

This is a Laravel package for (auto)translatable models. It provides functionality of multilingual models with an option of using external services for automatic translations. Google Cloud Translate is already integrated into the package and adding another service is made pretty easy.

If you're not interested in using any automatic translation services, and just looking to make your models multilingual I suggest using dismav/laravel-translatable package as it has a lot more history and community behind it is way way larger.

Index

Info

The package is create for Laravel 5.6 and 5.7.

Quick start

Step 1: Install package

Add the package in your composer.json by executing the command.

Next, add the service provider to config/app.php

Step 2: Set up the environment and migration.

Publish the migration file.

Set up your Google Cloud Translate/GCT service account and select your preferred way of authentication from Googe Cloud authenticiation docs. As Google supports authenticating through environment variables and it being really comfortable, this package is using it too. I prefer authenticating by setting GOOGLE_APPLICATION_CREDENTIALS variable to the path of the provided service account private key file.

Step 3: Add Translatable trait to model

The trait adds necessary translation relationship methods

Translation is "fresh" when the updated_at of the Translation model is older than the update_at of the Translatable model.

To create a translation manually, you can call method translate($field, $language, $value = null)

To use the GCT service, do not specify the value and the translation is retrieved and model created automatically.

translation method acts similarly and if $createIfNotFresh is set true, it tries to retrieve a fresh translation from the database and if none exists, uses the GCT service.

FAQ

Contribution

Feel free to create issues and make PRs to make this package better. I hope you do. :)


All versions of laravel-translatable with dependencies

PHP Build Version
Package Version
Requires google/cloud-translate Version ^1.2
php Version >=7.1.3
illuminate/support Version 5.6.*|5.7.*|5.8.*
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 mihkullorg/laravel-translatable contains the following files

Loading the files please wait ....