2026-01-15 01:13:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
refactor: settings redesign, Spanish translations, language system, strict_types
Settings pages:
- Redesign layout to match Sendkit (max-w-4xl, space-y-12, Separator sections)
- Merge Members page into Workspace settings with Table, invite Dialog, ConfirmDeleteModal
- Add workspace logo upload/delete routes and controller methods
- Translate all hardcoded strings in Workspace.vue modals
Language system:
- Drop languages table, replace language_id FK with locale string column on users
- Create config/languages.php for available languages and default locale
- Add Spanish (es) translations (13 files)
- Simplify HandleInertiaRequests, ProfileController, RegisteredUserController
Code quality:
- Add declare(strict_types=1) to all PHP files
- Fix MastodonPublisher using wrong attribute (filename -> original_filename)
- Fix HasMediaTest for new has_photo/photo_url accessors
- Fix PublishToSocialPlatformTest type error revealed by strict_types
- Remove orphaned Language model from AppServiceProvider morph map
- Update User TypeScript interface (has_photo, photo_url, locale)
- Eager load media relation on workspaces to prevent N+1
- Add 8 new tests for workspace logo upload/delete
- Update workspace settings test to assert members/invitations props
All 710 tests passing.
2026-03-30 03:20:43 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
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\Workspace;
|
2026-01-15 01:13:44 +00:00
|
|
|
|
2026-05-03 12:36:50 +00:00
|
|
|
use App\Enums\Workspace\BrandFont;
|
2026-05-08 16:38:30 +00:00
|
|
|
use App\Enums\Workspace\ImageStyle;
|
2026-01-15 01:13:44 +00:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
2026-05-03 12:36:50 +00:00
|
|
|
use Illuminate\Validation\Rule;
|
2026-01-15 01:13:44 +00:00
|
|
|
|
|
|
|
|
class StoreWorkspaceRequest extends FormRequest
|
|
|
|
|
{
|
|
|
|
|
public function authorize(): bool
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
2026-05-02 16:30:59 +00:00
|
|
|
$hex = ['nullable', 'string', 'regex:/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/'];
|
|
|
|
|
|
2026-01-15 01:13:44 +00:00
|
|
|
return [
|
|
|
|
|
'name' => ['required', 'string', 'max:255'],
|
2026-04-17 02:05:51 +00:00
|
|
|
'brand_website' => ['nullable', 'url', 'max:255'],
|
|
|
|
|
'brand_description' => ['nullable', 'string', 'max:2000'],
|
|
|
|
|
'brand_tone' => ['nullable', 'string', 'in:professional,casual,friendly,bold,inspirational,humorous,educational'],
|
|
|
|
|
'brand_voice_notes' => ['nullable', 'string', 'max:2000'],
|
2026-05-02 16:30:59 +00:00
|
|
|
'brand_color' => $hex,
|
|
|
|
|
'background_color' => $hex,
|
|
|
|
|
'text_color' => $hex,
|
2026-05-03 12:36:50 +00:00
|
|
|
'brand_font' => ['sometimes', 'string', Rule::in(BrandFont::values())],
|
2026-05-08 16:38:30 +00:00
|
|
|
'image_style' => ['sometimes', 'string', Rule::in(ImageStyle::values())],
|
2026-04-17 02:05:51 +00:00
|
|
|
'content_language' => ['nullable', 'string', 'in:en,pt-BR,es'],
|
|
|
|
|
'logo_url' => ['nullable', 'url', 'max:1024'],
|
2026-01-15 01:13:44 +00:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function messages(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'name.required' => 'O nome do workspace é obrigatório.',
|
|
|
|
|
'name.max' => 'O nome do workspace deve ter no máximo 255 caracteres.',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|