for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Mail;
use Mail;
use Illuminate\Mail\Message;
use Illuminate\Support\Facades\Password;
use Illuminate\Contracts\Events\Dispatcher;
use App\Services\Auth\Back\Events\UserCreated as BackUserCreated;
use App\Services\Auth\Front\Events\UserRegistered as FrontUserRegistered;
use App\Services\Auth\Front\Events\UserCreatedThroughBack as FrontUserCreatedThroughBack;
class EventHandler
{
public function subscribe(Dispatcher $events)
$events->listen(FrontUserRegistered::class, function (FrontUserRegistered $event) {
Mail::send(new Welcome($event->user));
new \App\Mail\Welcome($event->user)
object<App\Mail\Welcome>
string|array
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
});
$events->listen(FrontUserCreatedThroughBack::class, function (FrontUserCreatedThroughBack $event) {
Password::broker('front')->sendResetLink(['email' => $event->user->email], function (Message $message) {
$message->subject('Welkom bij '.config('app.url'));
$events->listen(BackUserCreated::class, function (BackUserCreated $event) {
Password::broker('back')->sendResetLink(['email' => $event->user->email], function (Message $message) {
}
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: