- How do I send a welcome notification to new users in Laravel?
- Use the `sendWelcomeNotification()` method on your user model after registration. Pass an expiry timestamp like `$user->sendWelcomeNotification(now()->addDay())`. The package includes a secure link for password setup.
- Does this package work with Laravel 10+ and PHP 8.1+?
- Yes, the package explicitly supports Laravel 10+ and requires PHP 8.1+. Always check the `composer.json` for exact version constraints before installing.
- Can I customize the welcome notification email or SMS content?
- Absolutely. Extend the `WelcomeNotification` class to override the default template or branding. The package leverages Laravel’s notification system, so you can use any supported channel (mail, Slack, etc.).
- What happens if a user clicks the password setup link after it expires?
- The link includes an `expiresAt` timestamp, and expired links will automatically redirect to a fallback route (configurable). You can customize this behavior in the published config file.
- How do I integrate this with Laravel’s built-in password reset system?
- This package is designed for *initial* password setup, not password resets. If your app uses Laravel’s `ResetPassword` notification, ensure you’re not duplicating logic. The welcome flow is distinct and time-limited.
- Does the package support multi-channel notifications (email, SMS, etc.)?
- Yes, it works with any Laravel notification channel (mail, Slack, SMS via Twilio, etc.). Just configure your preferred driver in the notification class or use Laravel’s `via()` method.
- How do I test the password setup link expiry and security?
- Mock the `expiresAt` timestamp in tests to simulate expired links. Verify redirects and edge cases like time zone handling. For security, test link hijacking by inspecting the generated URLs.
- Can I use this with Laravel Breeze or Jetstream for authentication?
- Yes, the package integrates seamlessly with Breeze/Jetstream. Replace or extend their registration logic to include `$user->sendWelcomeNotification(now()->addDay())` after user creation.
- What if the welcome notification fails to send (e.g., email bounce)?
- The package doesn’t include retry logic by default. Use Laravel’s `shouldQueue()` or a queue worker (e.g., Laravel Horizon) to handle failures asynchronously.
- Are there alternatives to this package for welcome emails?
- For basic welcome emails without password setup, Laravel’s built-in `Notification` system suffices. For GDPR-compliant, time-limited password flows, this package is a specialized and secure choice.