Download the PHP package msafadi/laravel-eloquent-l10n without Composer

On this page you can find all versions of the php package msafadi/laravel-eloquent-l10n. 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-eloquent-l10n

Laravel Eloquent Localization and Translation

In today's globalized world, reaching audiences across borders is more important than ever. To effectively engage users from diverse backgrounds, providing your website's content in their native language is crucial. However, managing content translations can be a complex and time-consuming process.

This is where the Laravel Eloquent Localization and Translation package comes in. It offers a comprehensive and developer-friendly solution to streamline your content translation workflow.

Challenges of Traditional Translation Management

Features

The Laravel Eloquent Localization and Translation package empowers you to:

By providing a flexible and developer-friendly solution, this package helps you efficiently manage content translations, ensuring a seamless experience for your global audience. This Laravel package empowers you to effortlessly manage translations for your Eloquent models. It offers two flexible approaches:

  1. Dedicated Translations Table: This structured approach allows each model to have its own translations table, potentially including additional columns for specific needs.
  2. Model Attributes: For simpler scenarios, translations can be stored directly as JSON within the model's attributes, providing a lightweight solution.

Installation

  1. Install the package using Composer:

  2. Optionally, you can publish the configuration file for customization:

  3. Add the package's service provider class EloquentL10nServiceProvider to the application's providers array

    • Laravel 11.x

    • Laravel 10.x and older

Configuration

The package configuration file (config/eloquent-l10n.php) provides options to tailor the package to your project's specific needs:

Usage

1. Dedicated Translations Table

1.1. Model Setup

1.2. Usage

The package performs a left join with the related translations table constraited with the specified locale code. This allow to access and call the translatable attributes from the parent model as if it was a single table.

1.3. Create and Save Translations

The package provide convenit ways to save model translations, by performing upserts on the translations table. If there's no existing translations for the specifed loacle it will be inserted otherwise it will updated.

1.4. Translations Relationship

The package also define HasNany relationships named translations.

You can also stop the default behaviour of the global scope which perform a join between the model table and its translations table, by calling withoutTranslations

1.5. Customization (Optional)

1.6. Artisan Command

Use the artisan command to generate a starting point for your translations table migration:

Replace MyModel with your actual model class name or the table name.

2. Model Attributes

2.1. Model Setup

2.2. Usage

2.3. Save Translations

Contributing

We value contributions to this package! Please refer to the contributing guide for details.

License

This package is open-sourced under the MIT license.


All versions of laravel-eloquent-l10n with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/container Version ^10.0|^11.0
illuminate/console Version ^10.0|^11.0
illuminate/database Version ^10.0|^11.0
illuminate/support Version ^10.0|^11.0
illuminate/config Version ^10.0|^11.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 msafadi/laravel-eloquent-l10n contains the following files

Loading the files please wait ....