2026-01-15 01:13:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
refactor: organize middleware/requests into App/ subdirs, add Resources, fix auth routes
- Move middleware to App/ subdir (HandleInertiaRequests, HandleAppearance,
EnsureSubscribed, EnsureUserSetupIsComplete) matching Sendkit pattern
- Move all Form Requests into organized subdirs (App/Post, App/Workspace,
App/Media, App/Invite, App/Settings, App/Auth)
- Create AuthUserResource and AuthWorkspaceResource for HandleInertiaRequests
shared data (role inside currentWorkspace, matching Sendkit pattern)
- Split auth.php into 3 route groups (no middleware, guest, auth) matching
Sendkit pattern exactly
- Fix UserFactory to include all nullable attributes (current_workspace_id,
stripe_id, pm_type, pm_last_four, trial_ends_at)
- Fix SocialAccountResource (display_name not name)
- Update frontend for new auth prop structure
- 702 tests passing (2 pre-existing Mastodon failures)
2026-03-30 00:13:30 +00:00
|
|
|
namespace App\Http\Requests\App\Invite;
|
2026-01-15 01:13:44 +00:00
|
|
|
|
2026-01-17 17:44:37 +00:00
|
|
|
use App\Enums\UserWorkspace\Role as WorkspaceRole;
|
2026-03-29 22:24:28 +00:00
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
2026-01-15 01:13:44 +00:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
|
|
|
|
|
|
class StoreWorkspaceInviteRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
|
*/
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
|
*
|
2026-03-29 22:24:28 +00:00
|
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
2026-01-15 01:13:44 +00:00
|
|
|
*/
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'email' => ['required', 'email', 'max:255'],
|
|
|
|
|
'role' => ['nullable', Rule::enum(WorkspaceRole::class)],
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get custom messages for validation errors.
|
|
|
|
|
*
|
|
|
|
|
* @return array<string, string>
|
|
|
|
|
*/
|
|
|
|
|
public function messages(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'email.required' => 'O email é obrigatório.',
|
|
|
|
|
'email.email' => 'Digite um email válido.',
|
|
|
|
|
'email.max' => 'O email deve ter no máximo 255 caracteres.',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|