app/Http/Controllers/CompanyUser (Guide) Controller.php: RegistrationInvite but not UserRegistrationInvite.
app/Http/Controllers/Auth/RegisteredUserController.php: but not app/Http/Controllers/RegisteredUserController.php:
Actually do we need edit scenario for users (guides)? For what we may edit an email in this way? If not we need to change / remove "update requests files" and it's methods in controllers.
Hello. I think in the function test_company_owner_can_send_invite_to_user the line $user = User::factory()->admin()->create(); should be $user = User::factory()->companyOwner()->create(); is this correct? Thanks.
"And the invitation email is now sent..." But I'm affraid I get an error here: Connection could not be established with host "mailpit:1025": stream_socket_client(): php_network_getaddresses: getaddrinfo for mailpit failed: Host is onbekend. / Is it necessary to register with mailgun.org? Can this be the reason for the failure? Thank you for the reply!
You need to use some email provider to send email, yes. It could be Mailgun or similar for real emails, or Mailpit/Mailtrap for fake emails. And yes, that's the reason for the failure.
Hello. Some questions / corrections:
Hello. I think in the function test_company_owner_can_send_invite_to_user the line $user = User::factory()->admin()->create(); should be $user = User::factory()->companyOwner()->create(); is this correct? Thanks.
same in the function test_company_owner_can_send_invite_to_guide_to_his_company
Thanks. Updated the lesson.
Hello. I think in the function test_company_owner_can_send_invite_to_user the line
$user = User::factory()->companyOwner()->create(); should be $user = User::factory()->companyOwner()->create(['company_id' => $company->id]);
if not, then in this line, the user doesn't have the same company $response->assertRedirect(route('companies.users.index', $company->id));
In this case it doesn't matter because we test different thing. But for consistency yes it would be better. Updated the lesson.
Yeah i noticed same thing i had to switch it like this for company owner
"And the invitation email is now sent..." But I'm affraid I get an error here: Connection could not be established with host "mailpit:1025": stream_socket_client(): php_network_getaddresses: getaddrinfo for mailpit failed: Host is onbekend. / Is it necessary to register with mailgun.org? Can this be the reason for the failure? Thank you for the reply!
You need to use some email provider to send email, yes. It could be Mailgun or similar for real emails, or Mailpit/Mailtrap for fake emails. And yes, that's the reason for the failure.