Category: Laravel

Building a Laravel Translation Package – Handling Missing Translation Keys

In the last instalment of this series, we talked about building the frontend translation management tool. In this article, we are going to move away from the frontend and follow the process of building another backend feature. One of the most frustrating things about translation management in a Laravel application is forgetting to add translations to the corresponding language file. This has the undesirable result of either the translation key or the default language being rendered on the page rather than the translation for the current language.  To mitigate this issue, the Laravel Translation package provides a way...

Read More

Laravel 5.7.16 Released

Laravel 5.7.16 is available with new translation messages for the 403 and 503 blade templates and enabling the migrator to accept not only migration directory paths but also file paths too. First up, the 403.blade.php file now has a translatable exception message and fallback: @section('message', __($exception->getMessage() ?: __('Sorry, you are forbidden from accessing this page.'))) Next, the 503.blade.php file has a translatable message and fallback is now as follows: @section('message', __($exception->getMessage() ?: __('Sorry, we are doing some maintenance. Please check back soon.'))) The last new addition is the migrator being able to handle both file paths and directories for...

Read More

Laravel WebSockets Package Released

Laravel WebSockets is a WebSockets server implemented in PHP for your Laravel projects. It’s also a drop-in replacement for Pusher via the Pusher protocol and Laravel Echo JavaScript server, which means all packages that work with Pusher will work with the Laravel WebSockets package. Running a WebSocket server is at your fingertips with artisan: php artisan websockets:serve The package also comes with an excellent Debug Dashboard which can help you speed up development of WebSocket features in your applications: Image credit: Official Debug Dashboard Documentation The initial Laravel Websockets release is a collaborative effort by Marcel Pociot and Freek...

Read More

Speeding Up PHP with OPcache in Docker

If you’re on Docker for Mac or Docker for Windows, you might see some noticeable slowness and time to the first byte (TTFB) depending on your application’s setup. One of the most important things you can do to improve performance is enabling the OPCache module (regardless of the development environment). There are other things like volume caching (if possible), but OPcache is a win that you want in any environment you’re running PHP applications. OPcache Settings When you enable the OPCache module, you need to consider a few things so that your configuration is development-friendly, yet, can be ready...

Read More