Download the PHP package yazeedobaid/laravel-lang without Composer
On this page you can find all versions of the php package yazeedobaid/laravel-lang. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yazeedobaid/laravel-lang
More information about yazeedobaid/laravel-lang
Files in yazeedobaid/laravel-lang
Package laravel-lang
Short Description Modular Export of Laravel translations for Front-End and API usage.
License MIT
Informations about the package laravel-lang
Laravel-Lang
Modular Export of Laravel translations for Front-End and API usage.
This package is inspired from the the way how CMSs built on top of Laravel work and how they are structured into packages for large-scale applications. In these CMSs, each package has its own langdirectory.
Also, this package has an exclude array to exclude lang files from each lang directory in these modular packages. And finally, an event is emitted after export is done.
Installation
Require this package, with Composer, in the root directory of your project.
Assets Publishing
To publish the config file of the package use:
Usage
Add this route to your Front-End side or call it as an API. http://your-web-app/js/lang.js
Config File
The config file contains configurations for the route to use for the translations, a middlewares array for the route to be applied to it. An events channel, to specify the event channel.
The keys for the 'paths' and 'files_to_exclude' arrays must be the same, since these keys define each package name (alias). Feel free to select you prefered name.
Example config file
Below is an example on the path of a package to get its translations with a excluded trans file in that package:
A Note to be Mentioned
This package was inspired from kg-bot/laravel-localization-to-vue.