-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
- Laravel Version: v5.5.32
- PHP Version: all
Description:
Here:
return "<?php echo app('translator')->getFromJson{$expression}; ?>"; |
trans()
instead of getFromJson
Steps To Reproduce:
Implement our own Translator service following the official interface:
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
class Translator implements TranslatorContract
{
public function trans($key, array $replace = [], $locale = null) { ... }
public function transChoice($key, $number, array $replace = [], $locale = null) { ... }
public function getLocale() { ... }
public function setLocale($locale) { ... }
}
Start to use it and get the following error:
Call to undefined method MyProject\Libraries\Translation\Translator::getFromJson() (View: /vagrant/resources/views/components/my-block.blade.php)
Disclamer
I'm just starting to use Laravel, so I may be wrong. All my apologies if it's the case
raphaelsaunier and amadeann
Metadata
Metadata
Assignees
Labels
No labels