sbkinfo / languable
Languages for laravel
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/sbkinfo/languable
This package is not auto-updated.
Last update: 2025-10-12 10:39:13 UTC
README
Languages package for laravel framework.
How to install
Run this command in terminal
composer require "sbkinfo/languable"
Include ServiceProvider in config/app.php
'providers' => array( SBKInfo\Languages\Provider::class, )
Use Languable in your controller
class HomeController extends Controller{ use SBKInfo\Languages\Languable; }
Example
public function __construct(){ $translate = $this->translate(); }
Settings
If you want to use other translate language file (resources/lang) you need pass to translate method path to your custom file, default file path has name as name Controller which was called in translate method
public function __construct(){ $translate = $this->translate('your-path'); }
Created file will be in app/Languages folder.
In order to create Language Class file, you need execute next command
php artisan make:language Language
If you want to create translate file, you need execute command with --lang option
php artisan make:language Language --lang=transfile