iget-master / laravel-strict-translator by iget-master

Enable strict mode for default Laravel Translator
156
0
2
Package Data
Maintainer Username: iget-master
Maintainer Contact: esoares@iget.com.br (Elias Soares)
Package Create Date: 2016-08-22
Package Last Update: 2017-07-26
Language: PHP
License: Unknown
Last Refreshed: 2024-11-22 03:03:46
Package Statistics
Total Downloads: 156
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laravel Strict Translator

Enable strict mode on default Laravel Translator.

Usage

Require this package on composer:

composer require iget-master/laravel-strict-translator

Replace Laravel's TranslationServiceProvider by our service provider:

//Illuminate\Translation\TranslationServiceProvider::class,
IgetMaster\StrictTranslator\StrictTranslatorServiceProvider::class,

Now when trying to use an invalid/unexisting translation key, you will receive an TranslationMissingException.

lang('unexisting.translation_key')

// TranslationMissingException: Translation key travel_resource.add_title not found.