Download the PHP package lechihuy/laratrans without Composer

On this page you can find all versions of the php package lechihuy/laratrans. 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 laratrans

Total Downloads Latest Stable Version License

Laratrans

Support multiple language resources for Laravel.

Docs

Installation

After you install the package successfully, open your terminal at your project and run the following command:

Configuration

You can configure the package in app/config/translatable.php, please read it to detail more.

Database

...

Model

Imaginary, you need to apply translation for Post model.

First, use the Laratrans\Translatable trait in Post model file as bellow:

Next, open your terminal and run the following command to create translation model:

The Translation namespace must be corresponding with translation_namespace in the configuration file. Besides, the suffix of translation model name must be Translation.

Post model need to translate title, description columns. You simple declare the translatedAttributes property in this model.

You need to declare eager loading to it work. The package that offers two eager loadings are translations and translation.

If you serialize a translatable model with translations eager loading, the response can be given as bellow:

Otherwise, if you use translation eager loading, the response won't contain translations property.

You also hidden a few redundant properties if you want via $hidden property in the model.

License

Laratrans is open-sourced software licensed under the MIT license.


All versions of laratrans with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
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 lechihuy/laratrans contains the following files

Loading the files please wait ...