Laravel: PHP 8 Support

PHP 8 has been officially released! We've been hard at work behind the scenes to provide support for all our libraries so that upgrading to PHP 8 with Laravel is easy.

First, make sure you're at the latest version of Laravel 6, 7 or 8 to get PHP 8 support. Then make sure you're on the very latest version of any first-party package from Laravel like Passport, Cashier, Dusk, etc.

There are also a couple of commonly used dependencies you'll need to update in your composer.json file:

  • PHP to php:^8.0
  • Faker to fakerphp/faker:^1.9.1
  • PHPUnit to phpunit/phpunit:^9.3

Finally, run composer update to update other packages. Make sure to test your application before updating production. That's it! Enjoy PHP 8!

PS: We're still working on providing PHP 8 support for Scout and Nexmo Notification Channel. We expect this to land soon.

Keep reading

General April 4, 2024

Encryption and the In-between

Last year, we introduced a simple but surprisingly useful feature to Laravel Forge: the ability to add notes to servers. While checking the uptake of this feature, we noticed that customers were often storing sensitive data in the field. We hadn’t designed notes to store sensitive information, so we found ourselves in a situation where we now needed to encrypt existing unencrypted data, while also allowing for new data to be inserted as encrypted data - at the same time, the dashboard needed to be able to show the notes correctly whether they had been encrypted or not. Our migration process looked like this: 1. Run a command that encrypts all existing unencrypted server notes. 2. Update our model to cast the `notes` field, encrypting or decrypting as required. To do this, we leaned on [Laravel’s custom casts](https://laravel.com/docs/11.x/eloquent-mutators#custom-casts) feature to handle this “sometimes encrypted” data. We created a new cast `SometimesEncrypted` that allowed us to gracefully decrypt the encrypted notes, or simply return the plaintext version which may have been available during the migration: ```php

James Brooks

Stay connected with the latest Laravel news