1. Go to this page and download the library: Download andmarruda/authmodule library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Andmarruda\AuthModule\Ports\Services\InvitationMailerInterface;
use App\CustomInvitationMailer;
public function register(): void
{
$this->app->bind(InvitationMailerInterface::class, CustomInvitationMailer::class);
}
use Andmarruda\AuthModule\Models\User;
use Andmarruda\AuthModule\Models\Invitation;
// Create a manager
$manager = User::factory()->manager()->create();
// Create a pending invitation
$invitation = Invitation::factory()->create(['invited_by' => $manager->id]);
// Create an expired invitation
$expired = Invitation::factory()->expired()->create();
// Create an already-accepted invitation
$accepted = Invitation::factory()->accepted()->create();