Download the PHP package cosnavel/laravel-query-localization without Composer

On this page you can find all versions of the php package cosnavel/laravel-query-localization. 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-query-localization

laravel-package_2

Query String Localization Package for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads


Use this package to localize your laravel application via query strings easily.

Features:


Installation

To get started, require the package via composer:

Config File

You can publish the config file with:

After publishing, config query-localization.php will be created.

The configuration options are:

Usage

Register Middleware

To get started, register the LocaleFromQuery middleware for the Route Group that needs to be localized.

User Language Preference

If you want to save the language preference to the users table:

You can publish and run the migrations with:

Helpers

Get Supported Locales

Return all supported locales and their properties as an array.

Get Current Locale

Return the key of the current locale.

Determine Valid Locales

Checks if the passed locale is a supportedLocale (check the config to add your needed locales). If it is not, the returned locale is the application's default locale.

Set Locale

Set locale programmatically. Internally the passed locale gets determined if it's a valid locale.

Set User Language Preference

Set an authed user's language preference. The passed language will also be checked for availability.

Language Selector

If you're supporting multiple locales in your project, you will probably want to provide the users with a way to change the language.

Included in this package is a language selector. The Language Selector is built with Tailwind, Alpine & Livewire.

https://user-images.githubusercontent.com/42392570/128573314-2fe1d2a8-1743-4533-8778-65009c957232.mp4

Alpine

The Language Picker requires Alpine. You can use the official CDN to quickly include Alpine:

Usage

Just include the Livewire Component in your blade view. All available locales from your config will be used.

When useUserLanguagePreference is enabled, the language preference of an authenticated user will be set.

If you don't want to use Tailwind or want to customize the language picker, I recommend that you publish the component the markup as you like.

Testing

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-query-localization with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/contracts Version ^8.73 || ^9.0
spatie/laravel-package-tools Version ^1.11
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 cosnavel/laravel-query-localization contains the following files

Loading the files please wait ....