Download the PHP package alexkramse/laravel-translatable-table without Composer

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

Laravel Translatable Table

Latest Stable Version Test Pint Check

Laravel Translatable Table is a package designed to simplify handling translations stored in a separate table. It provides traits, casts, and utilities to manage and interact with translatable attributes seamlessly.

Supported Laravel Versions

The package supports Laravel 8, 9, and 10.

Installation

To install the package, use Composer:

Configuration

After installation, publish the configuration file:

This will create a config/table-translations.php file, where you can define supported locales and configure translation settings.

Usage

Setting Up a Translatable Model

  1. Use the HasTranslatableTable trait in your model.
  2. Define the translatableTableAttributes method to specify which attributes are translatable.
  3. Ensure your model has a relationship to a translation model.

Example:

Creating a Translation Model

For each translatable model, you will need to create a corresponding translation model. For example, for the Article model, you will need to create a ArticleTranslation model like this:

This model should be associated with the article_translations table (or another name depending on your schema). It contains the translated fields and references the original model (in this case, Article).

Migration for Translations

You will also need to create a migration for the article_translations table. Here's an example migration:

Configuring Locales

Update the config/table-translations.php file to define the supported locales:

Interacting with Translations

You can manage translations directly via the i18n attribute on the translatable model:

Advanced Features

Notes

This is the first version of the package. The README and code may contain some inaccuracies or incomplete features. If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

Testing

To test the package functionality, include your tests using Laravel's testing tools or Pest framework.

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-translatable-table with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 alexkramse/laravel-translatable-table contains the following files

Loading the files please wait ...