Download the PHP package umbalaconmeogia/laravel-language-switcher without Composer

On this page you can find all versions of the php package umbalaconmeogia/laravel-language-switcher. 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-language-switcher

Laravel Language Switcher

A simple, CSS framework independent Laravel package for language switching.

Features

Installation

Configuration

Quick Setup

Publish all assets and configuration:

Selective Publishing

Publish only specific assets:

Usage

1. Add routes to your routes/web.php:

2. Add the middleware to your application (optional but recommended):

In your bootstrap/app.php:

3. Include the language switcher in your views:

Using the Blade component (recommended):

Or using the include directive (legacy):

Component Options

The Blade component supports a style attribute for different style variants:

Note: The language switcher uses a simple, clean design with inline CSS for maximum compatibility. The dropdown appears on hover and works without JavaScript.

4. Customize supported languages in config/language-switcher.php:

Advanced Configuration

Language Detection Methods

The package supports multiple language detection methods:

Middleware Features

Component Configuration

Security Features

API Support

Enhanced Features

Console Commands

The package provides several artisan commands for management:

API Endpoints

When API is enabled, the package provides RESTful endpoints:

Example API responses:

Event System

The package fires events when languages are changed:

Conditional Asset Loading

The package automatically loads CSS assets only when needed:

View Data Sharing

The package automatically shares language data with all views:

Language Enum

The package provides a Language enum class for easy language management:

Middleware

The package includes a SetLocale middleware that automatically sets the application locale based on the user's language preference stored in the session. This middleware:

Manual Middleware Registration

If you prefer to register the middleware manually, you can add it to your app/Http/Kernel.php:

Customization

License

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


All versions of laravel-language-switcher with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version >=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 umbalaconmeogia/laravel-language-switcher contains the following files

Loading the files please wait ...