php – Yii2: How to force using fallback MessageFormatter method?-ThrowExceptions

Exception or error: My website is with a hosting provider that has the MessageFormatter class available on the server (Linux, PHP 7.0.27) but it is an old ICU version (4.2.1) that doesn’t support my message {number,plural,=0{# available} =1{# available} other{# available}} and gives the error: Message pattern is invalid: Constructor failed msgfmt_create: message formatter creation …

php – Laravel EventListener doesn't fire-ThrowExceptions

Exception or error: I created an event and listener in Laravel, but the listener doesn’t fire. It does actually fire on my colleague’s machine. That makes me think that the actual code works and that the configuration is in order. Listener: <?php namespace App\Listeners\Consensus; use App\Events\Consensus\ManualGroupChannelNotificationEvent; use Illuminate\Support\Facades\Log; /** * Class ManualGroupChannelNotificationListener * @package App\Listeners\Consensus …

php – Laravel Eloquent – firstOrCreate() on a relationship-ThrowExceptions

Exception or error: When I try the firstOrCreate() on a relationship of another model, it does not work: Client::find($id)->users()->firstOrCreate(array(’email’ => $email)); This returns an error saying Call to undefined method Illuminate\Database\Query\Builder::firstOrCreate() Running this directly on the model User will work though. How to solve: This won’t work, you have to do it manually/directly using User …