Download the PHP package teknyo/laravel-locale-helper without Composer

On this page you can find all versions of the php package teknyo/laravel-locale-helper. 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-locale-helper

Laravel Locale Helper

A simple Laravel package providing languages, timezones, currencies, date formats, first-day-of-week management, and number formatting.

Installation

Publish the config:

Usage


Include/Exclude Usage

Exclude specific countries


Runtime Override

If you need to change filters at runtime, you can merge config on the fly:

Or expose a fluent helper on the service:


Quick-Start Blade Example

This guide explains how to implement a user-friendly phone number input that combines a country code selector with a local number input, ultimately submitting a standardized E.164 formatted phone number to your backend.

  1. The HTML Structure (Required for both methods) Regardless of which JavaScript method you choose, you need the following HTML structure in your Blade template. The element must include a data-phone-code attribute containing the numeric dialing code, which the JavaScript will use to construct the final E.164 number.

Method 1: Using the @localhelperscripts Blade Directive (Recommended) The package provides a custom Blade directive that automatically injects the necessary JavaScript to handle the input, format the number, and inject a hidden field containing the final E.164 formatted number.

Basic Usage If your HTML elements use the default IDs (phone_country and phone_number), simply add the directive at the bottom of your form or page:

What it does: Listens for changes on the select and input fields. Creates a hidden input named phone (by default). Populates it with the E.164 format (e.g., +12015550123) right before the form submits.

Advanced Usage (Custom IDs & Names) If you have multiple phone inputs on the same page (e.g., Billing and Shipping) or need to change the hidden field name, pass parameters to the directive:

Method 2: Manual Script Injection (Normal Script Way) If you prefer not to use the Blade directive, or if you are working in an environment where Blade directives aren't available (e.g., a standalone Vue/React component or a raw HTML file), you can inject the JavaScript manually.

Basic Implementation Add the following script block to your Blade template, typically inside an @push('scripts') block if you are using a layout that yields scripts at the bottom of the page.

Customizing the Manual Script To use this for a different set of inputs, simply change the constants at the top of the script:

Note: If you have multiple phone inputs on the same page using the manual method, you
must duplicate this script block for each input and ensure the IDs and HIDDEN_NAME are
unique for each block to avoid conflicts.

Handling the Data in Laravel (Backend) Regardless of which frontend method you use, the form will submit a hidden field containing the fully formatted E.164 phone number. Here is how to handle it in your Laravel Controller:

License

MIT


All versions of laravel-locale-helper with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.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 teknyo/laravel-locale-helper contains the following files

Loading the files please wait ...