Signature | Laravel 5: String Translation Public API
The signature of the getLocale method is: 1 public function getLocale ( ) ;
Showing 10 of 1,278 results.
The signature of the getLocale method is: 1 public function getLocale ( ) ;
For the following example, we will see how the results of calling the getLocale method change after we manipulate the currently configured default locale: 1 // Ask the Service Container for a translator instance. 2 $ translator = app ( '...
The locale method is an alias of the getLocale and share the same signatures and behavior. They can be used interchangeably.
The signature of the setFallback method is: 1 public function setFallback ( 2 $ locale 3 ) ;
In the following example, we will use the setFallback method to change the current fallback locale to it : 1 <?php 2 // Ask the Service Container for a translator instance. 3 $ translator = app ( ' translator ' ) ; 4 5 // Set the fallback locale...
The getFallback method is the logical counterpart to the setFallback method and can be used to determine the currently configured fallback locale.
The signature of the getFallback method is: 1 <?php 2 public function getFallback ( ) ;
In the following example, we will change the currently configured fallback locale and observe how the fallback locale setting changes as we manipulate it. 1 <?php 2 // Ask the Service Container for a translator instance. 3 $ translator = app ( '...
1 public function each ( 2 callable $ callback 3 ) ;
The following examples are trivial use cases of the each method in that we iterate each element of the collection and echo the element: 1 use Illuminate \ Support \ Collection ; 2 3 // Create a new collection instance. 4 $ collection = new...