Adds a single-select referral-source step between the goals and connect steps of onboarding. The choice is stored on users.referral_source and mirrored to PostHog, mirroring the existing persona and goals steps. - ReferralSource enum (12 sources) + nullable users.referral_source column - referralSource()/storeReferralSource() controller actions with the same self-hosted, subscribed, persona and goals guards as the sibling steps - connect() now requires a referral source before rendering - Single-select ReferralSource.vue page mirroring the goals step - Localized across all 15 locales
27 lines
538 B
PHP
27 lines
538 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\App\Onboarding;
|
|
|
|
use App\Enums\User\ReferralSource;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class StoreOnboardingReferralSourceRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'referral_source' => ['required', Rule::enum(ReferralSource::class)],
|
|
];
|
|
}
|
|
}
|