Showing 7 of 1,216 result(s)
By default, the Laravel task scheduler will run all tasks as a foreground process. When the task is running in the foreground, the before and after callbacks will be called (this is not the case when the task is executing in the background). This...
…t look like: Internally, the task scheduler will use the Service Container to execute the anonymous functions supplied to the before and after methods. This allows us to use dependency injection when defining our functions. In the following...
When building multi-lingual applications, it is often necessary to translate messages into multiple languages; often times translations are not always available at the time of release. To help us handle this situation, Laravel supports the concept...
…method, but allows you to retrieve translation lines from JSON-based language files. It accepts many of the same parameters, but does not allow us to specify a fallback locale (if a translation line cannot be found in the JSON-based language...
…of the examples, we passed in number to indicate the number of items in a collection. The choice method will allow you to pass in any object that implements PHP's Countable interface for the $number parameter (some examples are PHP arrays as well...
Like with many of the translator's public methods, we can specify the locale when calling the choice method via an argument to the $locale parameter. By default, Laravel will use the default configured locale when you invoke the choice method. We...
The Laravel translator also exposes a transChoice method which just acts as an alias to the choice method for backwards compatibility. Their signatures and behavior are the same.