From 8689e54e55daf3d66f7123452c691f78b44c184e Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sun, 29 Mar 2026 19:24:28 -0300 Subject: [PATCH 01/91] refactor: restructure to Actions, subdomain routes (app/api), API tokens - Extract business logic from controllers into Action classes: Post/, Workspace/, Hashtag/, Label/, Invite/, ApiKey/ - Create subdomain routing: app.trypost.test (Inertia dashboard), api.trypost.test (REST API with token auth) - Add ApiToken model with tp_ prefix, token_lookup/hash auth - Add AuthenticateApiToken middleware for API authentication - Create Api controllers with JSON Resources for all entities - Create App controllers that use Actions + Inertia responses - Organize Form Requests into Api/ and App/ directories - Add api_tokens migration - Update all route names with app. prefix - Update all tests to use new route names (684 passing) --- app/Actions/ApiKey/CreateApiKey.php | 34 +++ app/Actions/ApiKey/DeleteApiKey.php | 15 ++ app/Actions/Hashtag/CreateHashtag.php | 19 ++ app/Actions/Hashtag/DeleteHashtag.php | 15 ++ app/Actions/Hashtag/UpdateHashtag.php | 20 ++ app/Actions/Invite/CreateInvite.php | 26 ++ app/Actions/Invite/DeleteInvite.php | 15 ++ app/Actions/Invite/RemoveMember.php | 15 ++ app/Actions/Label/CreateLabel.php | 19 ++ app/Actions/Label/DeleteLabel.php | 15 ++ app/Actions/Label/UpdateLabel.php | 20 ++ app/Actions/Post/CreatePost.php | 45 ++++ app/Actions/Post/DeletePost.php | 15 ++ app/Actions/Post/UpdatePost.php | 76 ++++++ app/Actions/Workspace/CreateWorkspace.php | 29 ++ app/Actions/Workspace/DeleteWorkspace.php | 24 ++ app/Concerns/PasswordValidationRules.php | 5 +- app/Helpers/upload.php | 2 +- app/Http/Controllers/Api/ApiKeyController.php | 46 ++++ app/Http/Controllers/Api/Controller.php | 12 + .../Controllers/Api/HashtagController.php | 58 ++++ app/Http/Controllers/Api/LabelController.php | 58 ++++ app/Http/Controllers/Api/PostController.php | 83 ++++++ .../Controllers/Api/WorkspaceController.php | 16 ++ app/Http/Controllers/App/ApiKeyController.php | 78 ++++++ .../Controllers/App/BillingController.php | 128 +++++++++ app/Http/Controllers/App/Controller.php | 12 + app/Http/Controllers/App/MediaController.php | 152 +++++++++++ .../Controllers/App/OnboardingController.php | 110 ++++++++ app/Http/Controllers/App/PostController.php | 249 ++++++++++++++++++ .../App/Settings/PasswordController.php | 38 +++ .../App/Settings/ProfileController.php | 105 ++++++++ .../Controllers/App/WorkspaceController.php | 125 +++++++++ .../App/WorkspaceHashtagController.php | 105 ++++++++ .../App/WorkspaceInviteController.php | 136 ++++++++++ .../App/WorkspaceLabelController.php | 105 ++++++++ .../Auth/AcceptInviteController.php | 10 +- .../Auth/AuthenticatedSessionController.php | 2 +- .../Controllers/Auth/BlueskyController.php | 4 +- ...mailVerificationNotificationController.php | 2 +- .../EmailVerificationPromptController.php | 2 +- .../Controllers/Auth/FacebookController.php | 8 +- .../Controllers/Auth/InstagramController.php | 2 +- .../Controllers/Auth/LinkedInController.php | 2 +- .../Auth/LinkedInPageController.php | 8 +- .../Controllers/Auth/MastodonController.php | 10 +- .../Controllers/Auth/PinterestController.php | 2 +- .../Auth/RegisteredUserController.php | 4 +- .../Controllers/Auth/SocialController.php | 6 +- .../Controllers/Auth/ThreadsController.php | 2 +- .../Controllers/Auth/TikTokController.php | 2 +- .../Auth/VerifyEmailController.php | 4 +- app/Http/Controllers/Auth/XController.php | 2 +- .../Controllers/Auth/YouTubeController.php | 14 +- .../Middleware/Api/AuthenticateApiToken.php | 47 ++++ app/Http/Middleware/EnsureSubscribed.php | 4 +- .../Middleware/EnsureUserSetupIsComplete.php | 10 +- app/Http/Middleware/HandleAppearance.php | 2 +- .../Api/ApiKey/StoreApiKeyRequest.php | 26 ++ .../Api/Hashtag/StoreHashtagRequest.php | 26 ++ .../Api/Hashtag/UpdateHashtagRequest.php | 26 ++ .../Requests/Api/Label/StoreLabelRequest.php | 26 ++ .../Requests/Api/Label/UpdateLabelRequest.php | 26 ++ .../App/ApiKey/StoreApiKeyRequest.php | 26 ++ .../App/Hashtag/StoreHashtagRequest.php | 26 ++ .../Requests/App/Label/StoreLabelRequest.php | 26 ++ app/Http/Requests/Auth/LoginRequest.php | 7 +- .../Requests/StoreWorkspaceInviteRequest.php | 3 +- app/Http/Resources/Api/ApiKeyResource.php | 27 ++ app/Http/Resources/Api/HashtagResource.php | 25 ++ app/Http/Resources/Api/LabelResource.php | 25 ++ .../Resources/Api/PostPlatformResource.php | 27 ++ app/Http/Resources/Api/PostResource.php | 29 ++ .../Resources/Api/SocialAccountResource.php | 25 ++ app/Http/Resources/Api/WorkspaceResource.php | 25 ++ app/Mail/AccountDisconnected.php | 2 +- app/Mail/WorkspaceConnectionsDisconnected.php | 2 +- app/Mail/WorkspaceInvite.php | 2 +- app/Models/ApiToken.php | 70 +++++ app/Models/Media.php | 3 +- app/Models/Post.php | 3 +- app/Models/PostPlatform.php | 3 +- app/Models/SocialAccount.php | 3 +- app/Models/User.php | 3 +- app/Models/Workspace.php | 8 +- app/Models/WorkspaceHashtag.php | 3 +- app/Models/WorkspaceInvite.php | 3 +- app/Models/WorkspaceLabel.php | 3 +- app/Rules/Timezone.php | 3 +- bootstrap/app.php | 13 +- bootstrap/providers.php | 7 +- config/auth.php | 4 +- config/database.php | 5 +- database/factories/LanguageFactory.php | 3 +- database/factories/MediaFactory.php | 2 +- database/factories/PostFactory.php | 3 +- database/factories/PostPlatformFactory.php | 3 +- database/factories/SocialAccountFactory.php | 3 +- database/factories/UserFactory.php | 3 +- database/factories/WorkspaceFactory.php | 3 +- .../factories/WorkspaceHashtagFactory.php | 3 +- database/factories/WorkspaceInviteFactory.php | 3 +- database/factories/WorkspaceLabelFactory.php | 3 +- ...6_03_29_215341_create_api_tokens_table.php | 29 ++ lang/pt-br/passwords.php | 2 +- routes/api.php | 45 ++++ routes/app.php | 179 +++++++++++++ routes/auth.php | 57 ++-- routes/web.php | 148 +---------- tests/Feature/AcceptInviteControllerTest.php | 30 +-- tests/Feature/Auth/AuthenticationTest.php | 2 +- tests/Feature/Auth/EmailVerificationTest.php | 6 +- tests/Feature/Auth/RegistrationTest.php | 2 +- .../Auth/VerificationNotificationTest.php | 4 +- tests/Feature/BillingControllerTest.php | 20 +- .../Controllers/BillingControllerTest.php | 12 +- .../Feature/Controllers/ChunkedUploadTest.php | 18 +- .../Controllers/MediaControllerTest.php | 13 +- .../Controllers/OnboardingControllerTest.php | 20 +- tests/Feature/ExampleTest.php | 6 +- .../Jobs/PublishToSocialPlatformTest.php | 4 +- tests/Feature/MediaControllerTest.php | 16 +- .../Middleware/EnsureSubscribedTest.php | 30 +-- .../EnsureUserSetupIsCompleteTest.php | 20 +- tests/Feature/OnboardingControllerTest.php | 32 +-- tests/Feature/PostControllerTest.php | 68 ++--- tests/Feature/Settings/PasswordUpdateTest.php | 16 +- tests/Feature/Settings/ProfileUpdateTest.php | 52 ++-- .../Feature/Social/BlueskyControllerTest.php | 12 +- .../Feature/Social/FacebookControllerTest.php | 26 +- .../Social/InstagramControllerTest.php | 18 +- .../Feature/Social/LinkedInControllerTest.php | 14 +- .../Social/LinkedInPageControllerTest.php | 22 +- .../Feature/Social/MastodonControllerTest.php | 22 +- .../Social/PinterestControllerTest.php | 14 +- .../Feature/Social/ThreadsControllerTest.php | 14 +- tests/Feature/Social/TikTokControllerTest.php | 14 +- tests/Feature/Social/XControllerTest.php | 14 +- .../Feature/Social/YouTubeControllerTest.php | 24 +- tests/Feature/SocialControllerTest.php | 14 +- .../VerifyWorkspaceConnectionsTest.php | 4 +- tests/Feature/WorkspaceControllerTest.php | 60 ++--- .../WorkspaceHashtagControllerTest.php | 32 +-- .../Feature/WorkspaceInviteControllerTest.php | 28 +- .../Feature/WorkspaceLabelControllerTest.php | 34 +-- tests/Pest.php | 7 +- tests/Unit/ExampleTest.php | 2 +- tests/Unit/HelpersTest.php | 2 +- tests/Unit/Mail/AccountDisconnectedTest.php | 5 +- tests/Unit/Mail/WorkspaceInviteTest.php | 5 +- tests/Unit/Models/MediaTest.php | 1 - .../Unit/Services/InstagramPublisherTest.php | 4 +- tests/Unit/Services/LinkedInPublisherTest.php | 9 +- .../Services/Social/FacebookPublisherTest.php | 2 +- .../Social/InstagramPublisherTest.php | 2 +- .../Social/LinkedInTokenSynchronizerTest.php | 1 - .../Services/Social/ThreadsPublisherTest.php | 2 +- tests/Unit/Services/Social/XPublisherTest.php | 4 +- .../Services/Social/YouTubePublisherTest.php | 4 +- tests/Unit/Services/XPublisherTest.php | 6 +- tests/Unit/Services/YouTubePublisherTest.php | 4 +- tests/Unit/Traits/HasMediaTest.php | 3 +- 162 files changed, 3346 insertions(+), 658 deletions(-) create mode 100644 app/Actions/ApiKey/CreateApiKey.php create mode 100644 app/Actions/ApiKey/DeleteApiKey.php create mode 100644 app/Actions/Hashtag/CreateHashtag.php create mode 100644 app/Actions/Hashtag/DeleteHashtag.php create mode 100644 app/Actions/Hashtag/UpdateHashtag.php create mode 100644 app/Actions/Invite/CreateInvite.php create mode 100644 app/Actions/Invite/DeleteInvite.php create mode 100644 app/Actions/Invite/RemoveMember.php create mode 100644 app/Actions/Label/CreateLabel.php create mode 100644 app/Actions/Label/DeleteLabel.php create mode 100644 app/Actions/Label/UpdateLabel.php create mode 100644 app/Actions/Post/CreatePost.php create mode 100644 app/Actions/Post/DeletePost.php create mode 100644 app/Actions/Post/UpdatePost.php create mode 100644 app/Actions/Workspace/CreateWorkspace.php create mode 100644 app/Actions/Workspace/DeleteWorkspace.php create mode 100644 app/Http/Controllers/Api/ApiKeyController.php create mode 100644 app/Http/Controllers/Api/Controller.php create mode 100644 app/Http/Controllers/Api/HashtagController.php create mode 100644 app/Http/Controllers/Api/LabelController.php create mode 100644 app/Http/Controllers/Api/PostController.php create mode 100644 app/Http/Controllers/Api/WorkspaceController.php create mode 100644 app/Http/Controllers/App/ApiKeyController.php create mode 100644 app/Http/Controllers/App/BillingController.php create mode 100644 app/Http/Controllers/App/Controller.php create mode 100644 app/Http/Controllers/App/MediaController.php create mode 100644 app/Http/Controllers/App/OnboardingController.php create mode 100644 app/Http/Controllers/App/PostController.php create mode 100644 app/Http/Controllers/App/Settings/PasswordController.php create mode 100644 app/Http/Controllers/App/Settings/ProfileController.php create mode 100644 app/Http/Controllers/App/WorkspaceController.php create mode 100644 app/Http/Controllers/App/WorkspaceHashtagController.php create mode 100644 app/Http/Controllers/App/WorkspaceInviteController.php create mode 100644 app/Http/Controllers/App/WorkspaceLabelController.php create mode 100644 app/Http/Middleware/Api/AuthenticateApiToken.php create mode 100644 app/Http/Requests/Api/ApiKey/StoreApiKeyRequest.php create mode 100644 app/Http/Requests/Api/Hashtag/StoreHashtagRequest.php create mode 100644 app/Http/Requests/Api/Hashtag/UpdateHashtagRequest.php create mode 100644 app/Http/Requests/Api/Label/StoreLabelRequest.php create mode 100644 app/Http/Requests/Api/Label/UpdateLabelRequest.php create mode 100644 app/Http/Requests/App/ApiKey/StoreApiKeyRequest.php create mode 100644 app/Http/Requests/App/Hashtag/StoreHashtagRequest.php create mode 100644 app/Http/Requests/App/Label/StoreLabelRequest.php create mode 100644 app/Http/Resources/Api/ApiKeyResource.php create mode 100644 app/Http/Resources/Api/HashtagResource.php create mode 100644 app/Http/Resources/Api/LabelResource.php create mode 100644 app/Http/Resources/Api/PostPlatformResource.php create mode 100644 app/Http/Resources/Api/PostResource.php create mode 100644 app/Http/Resources/Api/SocialAccountResource.php create mode 100644 app/Http/Resources/Api/WorkspaceResource.php create mode 100644 app/Models/ApiToken.php create mode 100644 database/migrations/2026_03_29_215341_create_api_tokens_table.php create mode 100644 routes/api.php create mode 100644 routes/app.php diff --git a/app/Actions/ApiKey/CreateApiKey.php b/app/Actions/ApiKey/CreateApiKey.php new file mode 100644 index 00000000..1594cf9d --- /dev/null +++ b/app/Actions/ApiKey/CreateApiKey.php @@ -0,0 +1,34 @@ + $workspace->id, + 'name' => data_get($data, 'name'), + 'token_lookup' => substr($plainToken, 3, 16), + 'token_hash' => Hash::make($plainToken), + 'expires_at' => data_get($data, 'expires_at') + ? now()->parse(data_get($data, 'expires_at'))->endOfDay() + : null, + ]); + + return ['token' => $apiToken, 'plain_token' => $plainToken]; + } +} diff --git a/app/Actions/ApiKey/DeleteApiKey.php b/app/Actions/ApiKey/DeleteApiKey.php new file mode 100644 index 00000000..3957d656 --- /dev/null +++ b/app/Actions/ApiKey/DeleteApiKey.php @@ -0,0 +1,15 @@ +delete(); + } +} diff --git a/app/Actions/Hashtag/CreateHashtag.php b/app/Actions/Hashtag/CreateHashtag.php new file mode 100644 index 00000000..47e2eaa4 --- /dev/null +++ b/app/Actions/Hashtag/CreateHashtag.php @@ -0,0 +1,19 @@ +hashtags()->create([ + 'name' => data_get($data, 'name'), + 'hashtags' => data_get($data, 'hashtags'), + ]); + } +} diff --git a/app/Actions/Hashtag/DeleteHashtag.php b/app/Actions/Hashtag/DeleteHashtag.php new file mode 100644 index 00000000..82119e6b --- /dev/null +++ b/app/Actions/Hashtag/DeleteHashtag.php @@ -0,0 +1,15 @@ +delete(); + } +} diff --git a/app/Actions/Hashtag/UpdateHashtag.php b/app/Actions/Hashtag/UpdateHashtag.php new file mode 100644 index 00000000..ec9f98fb --- /dev/null +++ b/app/Actions/Hashtag/UpdateHashtag.php @@ -0,0 +1,20 @@ +update([ + 'name' => data_get($data, 'name'), + 'hashtags' => data_get($data, 'hashtags'), + ]); + + return $hashtag; + } +} diff --git a/app/Actions/Invite/CreateInvite.php b/app/Actions/Invite/CreateInvite.php new file mode 100644 index 00000000..465e17e7 --- /dev/null +++ b/app/Actions/Invite/CreateInvite.php @@ -0,0 +1,26 @@ +invites()->create([ + 'email' => data_get($data, 'email'), + 'role' => data_get($data, 'role', WorkspaceRole::Member), + ]); + + Mail::to($invite->email)->send(new WorkspaceInviteMail($invite)); + + return $invite; + } +} diff --git a/app/Actions/Invite/DeleteInvite.php b/app/Actions/Invite/DeleteInvite.php new file mode 100644 index 00000000..1170f4ad --- /dev/null +++ b/app/Actions/Invite/DeleteInvite.php @@ -0,0 +1,15 @@ +delete(); + } +} diff --git a/app/Actions/Invite/RemoveMember.php b/app/Actions/Invite/RemoveMember.php new file mode 100644 index 00000000..0e978ec8 --- /dev/null +++ b/app/Actions/Invite/RemoveMember.php @@ -0,0 +1,15 @@ +members()->detach($userId); + } +} diff --git a/app/Actions/Label/CreateLabel.php b/app/Actions/Label/CreateLabel.php new file mode 100644 index 00000000..7ab1d95a --- /dev/null +++ b/app/Actions/Label/CreateLabel.php @@ -0,0 +1,19 @@ +labels()->create([ + 'name' => data_get($data, 'name'), + 'color' => data_get($data, 'color'), + ]); + } +} diff --git a/app/Actions/Label/DeleteLabel.php b/app/Actions/Label/DeleteLabel.php new file mode 100644 index 00000000..6e58fc22 --- /dev/null +++ b/app/Actions/Label/DeleteLabel.php @@ -0,0 +1,15 @@ +delete(); + } +} diff --git a/app/Actions/Label/UpdateLabel.php b/app/Actions/Label/UpdateLabel.php new file mode 100644 index 00000000..bfc0cb86 --- /dev/null +++ b/app/Actions/Label/UpdateLabel.php @@ -0,0 +1,20 @@ +update([ + 'name' => data_get($data, 'name'), + 'color' => data_get($data, 'color'), + ]); + + return $label; + } +} diff --git a/app/Actions/Post/CreatePost.php b/app/Actions/Post/CreatePost.php new file mode 100644 index 00000000..7e719cb6 --- /dev/null +++ b/app/Actions/Post/CreatePost.php @@ -0,0 +1,45 @@ +timezone)->format('Y-m-d'); + $scheduledAt = Carbon::parse($date, $workspace->timezone) + ->setTime(9, 0) + ->utc(); + + $post = $workspace->posts()->create([ + 'user_id' => $user->id, + 'status' => PostStatus::Draft, + 'synced' => true, + 'scheduled_at' => $scheduledAt, + ]); + + $socialAccounts = $workspace->socialAccounts; + + foreach ($socialAccounts as $account) { + $post->postPlatforms()->create([ + 'social_account_id' => $account->id, + 'platform' => $account->platform->value, + 'content' => '', + 'content_type' => ContentType::defaultFor($account->platform), + 'status' => 'pending', + 'enabled' => true, + ]); + } + + return $post; + } +} diff --git a/app/Actions/Post/DeletePost.php b/app/Actions/Post/DeletePost.php new file mode 100644 index 00000000..071933c9 --- /dev/null +++ b/app/Actions/Post/DeletePost.php @@ -0,0 +1,15 @@ +delete(); + } +} diff --git a/app/Actions/Post/UpdatePost.php b/app/Actions/Post/UpdatePost.php new file mode 100644 index 00000000..8658a78c --- /dev/null +++ b/app/Actions/Post/UpdatePost.php @@ -0,0 +1,76 @@ +status === PostStatus::Published) { + return ['post' => $post, 'action' => 'already_published']; + } + + $scheduledAt = $post->scheduled_at; + if (data_get($data, 'scheduled_at')) { + $scheduledAt = Carbon::parse(data_get($data, 'scheduled_at'), $workspace->timezone)->utc(); + } + + $status = data_get($data, 'status', $post->status); + + $post->update([ + 'status' => $status === 'publishing' ? PostStatus::Publishing : $status, + 'synced' => data_get($data, 'synced', $post->synced), + 'scheduled_at' => $scheduledAt, + ]); + + if (array_key_exists('label_ids', $data)) { + $post->labels()->sync(data_get($data, 'label_ids', [])); + } + + $post->postPlatforms()->update(['enabled' => false]); + + foreach (data_get($data, 'platforms', []) as $platformData) { + $updateData = [ + 'enabled' => true, + 'content' => data_get($platformData, 'content'), + ]; + + if (data_get($platformData, 'content_type') !== null) { + $updateData['content_type'] = data_get($platformData, 'content_type'); + } + + if (isset($platformData['meta'])) { + $postPlatform = $post->postPlatforms()->where('id', data_get($platformData, 'id'))->first(); + $updateData['meta'] = array_merge($postPlatform->meta ?? [], $platformData['meta']); + } + + $post->postPlatforms() + ->where('id', data_get($platformData, 'id')) + ->update($updateData); + } + + if ($status === 'publishing') { + $post->update(['scheduled_at' => now()]); + PublishPost::dispatch($post); + + return ['post' => $post, 'action' => 'publishing']; + } + + if ($status === 'scheduled') { + return ['post' => $post, 'action' => 'scheduled']; + } + + return ['post' => $post, 'action' => null]; + } +} diff --git a/app/Actions/Workspace/CreateWorkspace.php b/app/Actions/Workspace/CreateWorkspace.php new file mode 100644 index 00000000..37260a1b --- /dev/null +++ b/app/Actions/Workspace/CreateWorkspace.php @@ -0,0 +1,29 @@ + $user->id, + ...$data, + 'timezone' => config('app.timezone', 'UTC'), + ]); + + $workspace->members()->attach($user->id, ['role' => 'owner']); + $user->switchWorkspace($workspace); + + if ($user->hasActiveSubscription()) { + $user->incrementWorkspaceQuantity(); + } + + return $workspace; + } +} diff --git a/app/Actions/Workspace/DeleteWorkspace.php b/app/Actions/Workspace/DeleteWorkspace.php new file mode 100644 index 00000000..f737fcee --- /dev/null +++ b/app/Actions/Workspace/DeleteWorkspace.php @@ -0,0 +1,24 @@ +current_workspace_id === $workspace->id) { + $user->update(['current_workspace_id' => null]); + } + + $workspace->delete(); + + if ($user->hasActiveSubscription()) { + $user->decrementWorkspaceQuantity(); + } + } +} diff --git a/app/Concerns/PasswordValidationRules.php b/app/Concerns/PasswordValidationRules.php index 9b45ef09..e8583028 100644 --- a/app/Concerns/PasswordValidationRules.php +++ b/app/Concerns/PasswordValidationRules.php @@ -2,6 +2,7 @@ namespace App\Concerns; +use Illuminate\Contracts\Validation\Rule; use Illuminate\Validation\Rules\Password; trait PasswordValidationRules @@ -9,7 +10,7 @@ trait PasswordValidationRules /** * Get the validation rules used to validate passwords. * - * @return array|string> + * @return array|string> */ protected function passwordRules(): array { @@ -19,7 +20,7 @@ protected function passwordRules(): array /** * Get the validation rules used to validate the current password. * - * @return array|string> + * @return array|string> */ protected function currentPasswordRules(): array { diff --git a/app/Helpers/upload.php b/app/Helpers/upload.php index 1f475991..72b5c986 100644 --- a/app/Helpers/upload.php +++ b/app/Helpers/upload.php @@ -49,7 +49,7 @@ function uploadFromUrl(?string $url, string $directory = 'social-accounts'): ?st Storage::put($filename, $response->body(), 'public'); return $filename; - } catch (\Exception $e) { + } catch (Exception $e) { Log::warning('uploadFromUrl: Exception', [ 'url' => $url, 'error' => $e->getMessage(), diff --git a/app/Http/Controllers/Api/ApiKeyController.php b/app/Http/Controllers/Api/ApiKeyController.php new file mode 100644 index 00000000..83d5bb68 --- /dev/null +++ b/app/Http/Controllers/Api/ApiKeyController.php @@ -0,0 +1,46 @@ +workspace->apiTokens()->latest()->get(); + + return ApiKeyResource::collection($apiKeys); + } + + public function store(StoreApiKeyRequest $request): JsonResponse + { + $result = CreateApiKey::execute($request->workspace, $request->validated()); + + return response()->json([ + 'token' => new ApiKeyResource(data_get($result, 'token')), + 'plain_token' => data_get($result, 'plain_token'), + ], Response::HTTP_CREATED); + } + + public function destroy(Request $request, ApiToken $apiToken): JsonResponse + { + if ($apiToken->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + DeleteApiKey::execute($apiToken); + + return response()->json(null, Response::HTTP_NO_CONTENT); + } +} diff --git a/app/Http/Controllers/Api/Controller.php b/app/Http/Controllers/Api/Controller.php new file mode 100644 index 00000000..2fda368d --- /dev/null +++ b/app/Http/Controllers/Api/Controller.php @@ -0,0 +1,12 @@ +workspace->hashtags()->latest()->get(); + + return HashtagResource::collection($hashtags); + } + + public function store(StoreHashtagRequest $request): JsonResponse + { + $hashtag = CreateHashtag::execute($request->workspace, $request->validated()); + + return (new HashtagResource($hashtag)) + ->response() + ->setStatusCode(Response::HTTP_CREATED); + } + + public function update(UpdateHashtagRequest $request, WorkspaceHashtag $hashtag): HashtagResource + { + if ($hashtag->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + $hashtag = UpdateHashtag::execute($hashtag, $request->validated()); + + return new HashtagResource($hashtag); + } + + public function destroy(Request $request, WorkspaceHashtag $hashtag): JsonResponse + { + if ($hashtag->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + DeleteHashtag::execute($hashtag); + + return response()->json(null, Response::HTTP_NO_CONTENT); + } +} diff --git a/app/Http/Controllers/Api/LabelController.php b/app/Http/Controllers/Api/LabelController.php new file mode 100644 index 00000000..a453ace0 --- /dev/null +++ b/app/Http/Controllers/Api/LabelController.php @@ -0,0 +1,58 @@ +workspace->labels()->latest()->get(); + + return LabelResource::collection($labels); + } + + public function store(StoreLabelRequest $request): JsonResponse + { + $label = CreateLabel::execute($request->workspace, $request->validated()); + + return (new LabelResource($label)) + ->response() + ->setStatusCode(Response::HTTP_CREATED); + } + + public function update(UpdateLabelRequest $request, WorkspaceLabel $label): LabelResource + { + if ($label->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + $label = UpdateLabel::execute($label, $request->validated()); + + return new LabelResource($label); + } + + public function destroy(Request $request, WorkspaceLabel $label): JsonResponse + { + if ($label->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + DeleteLabel::execute($label); + + return response()->json(null, Response::HTTP_NO_CONTENT); + } +} diff --git a/app/Http/Controllers/Api/PostController.php b/app/Http/Controllers/Api/PostController.php new file mode 100644 index 00000000..55ce2fbd --- /dev/null +++ b/app/Http/Controllers/Api/PostController.php @@ -0,0 +1,83 @@ +workspace->posts() + ->with(['postPlatforms.socialAccount', 'user', 'labels']) + ->latest('scheduled_at') + ->paginate(15); + + return PostResource::collection($posts); + } + + public function show(Request $request, Post $post): PostResource + { + if ($post->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + $post->load(['postPlatforms.socialAccount', 'user', 'labels']); + + return new PostResource($post); + } + + public function store(Request $request): JsonResponse + { + $post = CreatePost::execute( + $request->workspace, + $request->workspace->members()->first(), + $request->all() + ); + + $post->load(['postPlatforms.socialAccount']); + + return (new PostResource($post)) + ->response() + ->setStatusCode(Response::HTTP_CREATED); + } + + public function update(Request $request, Post $post): PostResource|JsonResponse + { + if ($post->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + $result = UpdatePost::execute($request->workspace, $post, $request->all()); + + if (data_get($result, 'action') === 'already_published') { + return response()->json( + ['message' => 'Cannot edit a published post.'], + Response::HTTP_UNPROCESSABLE_ENTITY + ); + } + + return new PostResource(data_get($result, 'post')); + } + + public function destroy(Request $request, Post $post): JsonResponse + { + if ($post->workspace_id !== $request->workspace->id) { + abort(Response::HTTP_NOT_FOUND); + } + + DeletePost::execute($post); + + return response()->json(null, Response::HTTP_NO_CONTENT); + } +} diff --git a/app/Http/Controllers/Api/WorkspaceController.php b/app/Http/Controllers/Api/WorkspaceController.php new file mode 100644 index 00000000..4bb7340a --- /dev/null +++ b/app/Http/Controllers/Api/WorkspaceController.php @@ -0,0 +1,16 @@ +workspace); + } +} diff --git a/app/Http/Controllers/App/ApiKeyController.php b/app/Http/Controllers/App/ApiKeyController.php new file mode 100644 index 00000000..397b6d88 --- /dev/null +++ b/app/Http/Controllers/App/ApiKeyController.php @@ -0,0 +1,78 @@ +user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + return Inertia::render('settings/ApiKeys', [ + 'workspace' => $workspace, + 'apiTokens' => $workspace->apiTokens()->latest()->get(), + ]); + } + + public function store(Request $request): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'expires_at' => ['nullable', 'date', 'after:today'], + ]); + + $result = CreateApiKey::execute($workspace, $validated); + + session()->flash('flash.banner', __('settings.api_keys.flash.created')); + session()->flash('flash.bannerStyle', 'success'); + session()->flash('flash.plainToken', data_get($result, 'plain_token')); + + return back(); + } + + public function destroy(Request $request, ApiToken $apiToken): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($apiToken->workspace_id !== $workspace->id) { + abort(404); + } + + DeleteApiKey::execute($apiToken); + + session()->flash('flash.banner', __('settings.api_keys.flash.deleted')); + session()->flash('flash.bannerStyle', 'success'); + + return back(); + } +} diff --git a/app/Http/Controllers/App/BillingController.php b/app/Http/Controllers/App/BillingController.php new file mode 100644 index 00000000..8a33f0a7 --- /dev/null +++ b/app/Http/Controllers/App/BillingController.php @@ -0,0 +1,128 @@ +user(); + + if ($user->subscribed('default')) { + return redirect()->route('app.billing.index'); + } + + return Inertia::render('billing/Subscribe', [ + 'trialDays' => config('cashier.trial_days'), + ]); + } + + public function index(Request $request): Response + { + $user = $request->user(); + $subscription = $user->subscription('default'); + + return Inertia::render('billing/Index', [ + 'hasSubscription' => $user->subscribed('default'), + 'onTrial' => $subscription?->onTrial() ?? false, + 'trialEndsAt' => $subscription?->trial_ends_at?->toFormattedDateString(), + 'subscription' => $subscription?->only([ + 'stripe_status', + 'quantity', + 'ends_at', + ]), + 'workspacesCount' => $user->ownedWorkspacesCount(), + 'invoices' => $user->invoices()->map(fn ($invoice) => [ + 'id' => $invoice->id, + 'date' => $invoice->date()->toFormattedDateString(), + 'total' => $invoice->total(), + 'status' => $invoice->status, + 'invoice_pdf' => $invoice->invoice_pdf, + ]), + 'defaultPaymentMethod' => $user->defaultPaymentMethod()?->card?->only([ + 'brand', + 'last4', + 'exp_month', + 'exp_year', + ]), + ]); + } + + public function checkout(Request $request): SymfonyResponse + { + $user = $request->user(); + + $subscription = $user->newSubscription('default', config('cashier.plans.monthly.price_id')) + ->allowPromotionCodes() + ->trialDays(config('cashier.trial_days')) + ->quantity(1); + + $checkoutSession = $subscription->checkout([ + 'success_url' => route('app.billing.processing').'?status=success', + 'cancel_url' => route('app.billing.processing').'?status=cancelled', + ]); + + return Inertia::location($checkoutSession->url); + } + + public function processing(Request $request): Response|RedirectResponse + { + $user = $request->user(); + $status = $request->query('status', 'processing'); + + if ($user->subscribed('default')) { + return redirect()->route('app.calendar'); + } + + if (! in_array($status, ['processing', 'success', 'cancelled'])) { + $status = 'processing'; + } + + return Inertia::render('billing/Processing', [ + 'userId' => $user->id, + 'status' => $status, + ]); + } + + public function portal(Request $request): RedirectResponse + { + return $request->user()->redirectToBillingPortal( + route('app.billing.index') + ); + } + + public function addWorkspace(Request $request): RedirectResponse + { + $user = $request->user(); + + if (! $user->subscribed('default')) { + return redirect()->route('app.billing.index') + ->withErrors(['subscription' => 'You need an active subscription.']); + } + + $user->incrementWorkspaceQuantity(); + + return back()->with('success', 'Workspace added to subscription.'); + } + + public function removeWorkspace(Request $request): RedirectResponse + { + $user = $request->user(); + + if (! $user->subscribed('default')) { + return back(); + } + + $user->decrementWorkspaceQuantity(); + + return back()->with('success', 'Workspace removed from subscription.'); + } +} diff --git a/app/Http/Controllers/App/Controller.php b/app/Http/Controllers/App/Controller.php new file mode 100644 index 00000000..e5cc1701 --- /dev/null +++ b/app/Http/Controllers/App/Controller.php @@ -0,0 +1,12 @@ +resolveModel($request->input('model'), $request->input('model_id')); + $collection = $request->input('collection', 'default'); + + $media = $model->addMedia( + $request->file('media'), + $collection + ); + + return response()->json([ + 'id' => $media->id, + 'group_id' => $media->group_id, + 'url' => $media->url, + 'type' => $media->type->value, + 'original_filename' => $media->original_filename, + ]); + } + + public function storeChunked(StoreChunkedMediaRequest $request): JsonResponse + { + $tempFile = $this->chunkTempPath($request->chunkIdentifier()); + + $this->appendChunk($tempFile, $request->getContent(), $request->isFirstChunk()); + + if (! $request->isLastChunk()) { + return response()->json([ + 'done' => false, + 'progress' => $request->progress(), + ]); + } + + $model = $this->resolveModel($request->input('model'), $request->input('model_id')); + + $media = $model->addMediaFromPath( + $tempFile, + $request->input('file_name'), + $request->input('collection'), + ); + + @unlink($tempFile); + + return response()->json([ + 'done' => true, + 'id' => $media->id, + 'group_id' => $media->group_id, + 'url' => $media->url, + 'type' => $media->type->value, + 'original_filename' => $media->original_filename, + ]); + } + + public function destroy(string $modelId, Media $media): JsonResponse + { + if ($media->mediable_id !== $modelId) { + abort(403); + } + + $media->delete(); + + return response()->json(['success' => true]); + } + + public function reorder(Request $request): JsonResponse + { + $request->validate([ + 'media' => 'required|array', + 'media.*.id' => 'required|exists:medias,id', + 'media.*.order' => 'required|integer|min:0', + ]); + + foreach ($request->input('media') as $item) { + Media::where('id', $item['id'])->update(['order' => $item['order']]); + } + + return response()->json(['success' => true]); + } + + public function duplicate(Media $media, Request $request): JsonResponse + { + $targets = $request->input('targets', []); + $duplicates = []; + + foreach ($targets as $target) { + $model = $this->resolveModel($target['model'], $target['model_id']); + $collection = $target['collection'] ?? $media->collection; + + $duplicate = $model->media()->create([ + 'group_id' => $media->group_id, + 'collection' => $collection, + 'type' => $media->type, + 'path' => $media->path, + 'original_filename' => $media->original_filename, + 'mime_type' => $media->mime_type, + 'size' => $media->size, + 'order' => $media->order, + 'meta' => $media->meta, + ]); + + $duplicates[] = [ + 'id' => $duplicate->id, + 'group_id' => $duplicate->group_id, + 'mediable_id' => $duplicate->mediable_id, + 'mediable_type' => $duplicate->mediable_type, + 'url' => $duplicate->url, + 'type' => $duplicate->type->value, + 'original_filename' => $duplicate->original_filename, + ]; + } + + return response()->json($duplicates); + } + + private function resolveModel(string $alias, string $id): Model + { + $modelClass = Relation::getMorphedModel($alias) ?? $alias; + + return $modelClass::findOrFail($id); + } + + private function chunkTempPath(string $identifier): string + { + return storage_path("app/private/chunks/{$identifier}"); + } + + private function appendChunk(string $path, string $content, bool $isFirst): void + { + $directory = dirname($path); + + if (! is_dir($directory)) { + mkdir($directory, 0755, true); + } + + file_put_contents($path, $content, $isFirst ? 0 : FILE_APPEND); + } +} diff --git a/app/Http/Controllers/App/OnboardingController.php b/app/Http/Controllers/App/OnboardingController.php new file mode 100644 index 00000000..17fd7ad6 --- /dev/null +++ b/app/Http/Controllers/App/OnboardingController.php @@ -0,0 +1,110 @@ + Persona::toSelectArray(), + ]); + } + + public function storeStep1(Request $request): RedirectResponse + { + $validated = $request->validate([ + 'persona' => ['required', Rule::enum(Persona::class)], + ]); + + $request->user()->update([ + 'persona' => $validated['persona'], + 'setup' => Setup::Connections, + ]); + + return redirect()->route('app.onboarding.step2'); + } + + public function step2(Request $request): Response + { + $user = $request->user(); + $workspace = $user->currentWorkspace; + + $platforms = collect(); + + if ($workspace) { + $connectedAccounts = $workspace->socialAccounts; + + $platforms = collect(SocialPlatform::enabled())->map(fn ($platform) => [ + 'value' => $platform->value, + 'label' => $platform->label(), + 'color' => $platform->color(), + 'connected' => $connectedAccounts->firstWhere('platform', $platform) !== null, + 'account' => $connectedAccounts->firstWhere('platform', $platform), + ])->values(); + } + + return Inertia::render('onboarding/Step2', [ + 'platforms' => $platforms, + 'hasWorkspace' => $workspace !== null, + ]); + } + + public function storeStep2(Request $request): SymfonyResponse|RedirectResponse + { + $user = $request->user(); + + if (config('trypost.self_hosted')) { + $user->update([ + 'setup' => Setup::Completed, + ]); + + session()->flash('flash.banner', __('auth.flash.welcome')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.calendar'); + } + + $user->update([ + 'setup' => Setup::Subscription, + ]); + + $subscription = $user->newSubscription('default', config('cashier.plans.monthly.price_id')) + ->allowPromotionCodes() + ->trialDays(config('cashier.trial_days')) + ->quantity(1); + + $checkoutSession = $subscription->checkout([ + 'success_url' => route('app.onboarding.complete').'?session_id={CHECKOUT_SESSION_ID}', + 'cancel_url' => route('app.onboarding.step2'), + ]); + + return Inertia::location($checkoutSession->url); + } + + public function complete(Request $request): RedirectResponse + { + $user = $request->user(); + + $user->update([ + 'setup' => Setup::Completed, + ]); + + session()->flash('flash.banner', __('auth.flash.welcome_trial')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.calendar'); + } +} diff --git a/app/Http/Controllers/App/PostController.php b/app/Http/Controllers/App/PostController.php new file mode 100644 index 00000000..cf2e8482 --- /dev/null +++ b/app/Http/Controllers/App/PostController.php @@ -0,0 +1,249 @@ +user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + $query = $workspace->posts() + ->with(['postPlatforms' => fn ($query) => $query->where('enabled', true)->with('socialAccount'), 'user', 'labels']); + + if ($status) { + $query = match ($status) { + 'draft' => $query->draft(), + 'scheduled' => $query->scheduled(), + 'published' => $query->published(), + default => $query, + }; + } + + return Inertia::render('posts/Index', [ + 'workspace' => $workspace, + 'posts' => Inertia::scroll(fn () => $query->latest('scheduled_at')->paginate(15)), + 'currentStatus' => $status, + ]); + } + + public function calendar(Request $request): Response|RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + $tz = $workspace->timezone; + $view = $request->input('view', 'week'); + + $currentDay = $request->input('day') + ? Carbon::parse($request->input('day'), $tz)->startOfDay() + : Carbon::now($tz)->startOfDay(); + + $weekStart = $request->input('week') + ? Carbon::parse($request->input('week'), $tz)->startOfWeek() + : Carbon::now($tz)->startOfWeek(); + $weekEnd = $weekStart->copy()->endOfWeek(); + + $monthDate = $request->input('month') + ? Carbon::parse($request->input('month'), $tz)->startOfMonth() + : Carbon::now($tz)->startOfMonth(); + $monthStart = $monthDate->copy()->startOfMonth()->startOfWeek(); + $monthEnd = $monthDate->copy()->endOfMonth()->endOfWeek(); + + $rangeStart = match ($view) { + 'day' => $currentDay, + 'month' => $monthStart, + default => $weekStart, + }; + $rangeEnd = match ($view) { + 'day' => $currentDay->copy()->endOfDay(), + 'month' => $monthEnd, + default => $weekEnd, + }; + + $posts = $workspace->posts() + ->with(['postPlatforms' => fn ($query) => $query->where('enabled', true)->with('socialAccount')]) + ->whereBetween('scheduled_at', [$rangeStart->copy()->utc(), $rangeEnd->copy()->utc()]) + ->orderBy('scheduled_at') + ->get() + ->groupBy(fn ($post) => $post->scheduled_at?->setTimezone($tz)->format('Y-m-d')); + + return Inertia::render('posts/Calendar', [ + 'workspace' => $workspace, + 'posts' => $posts, + 'currentDay' => $currentDay->format('Y-m-d'), + 'currentWeekStart' => $weekStart->format('Y-m-d'), + 'currentMonth' => $monthDate->format('Y-m-d'), + 'view' => $view, + ]); + } + + public function store(Request $request): RedirectResponse|\Symfony\Component\HttpFoundation\Response + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + $socialAccounts = $workspace->socialAccounts; + + if ($socialAccounts->isEmpty()) { + session()->flash('flash.banner', __('posts.flash.connect_first')); + session()->flash('flash.bannerStyle', 'danger'); + + return redirect()->route('app.accounts'); + } + + $post = CreatePost::execute($workspace, $request->user(), [ + 'date' => $request->input('date'), + ]); + + return Inertia::location(route('app.posts.edit', $post)); + } + + public function edit(Request $request, Post $post): Response|RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($post->workspace_id !== $workspace->id) { + abort(404); + } + + $post->load(['postPlatforms.socialAccount', 'postPlatforms.media', 'labels']); + $socialAccounts = $workspace->socialAccounts; + $labels = $workspace->labels; + $hashtags = $workspace->hashtags; + + $platformConfigs = $socialAccounts->mapWithKeys(fn ($account) => [ + $account->id => [ + 'maxContentLength' => $account->platform->maxContentLength(), + 'maxImages' => $account->platform->maxImages(), + 'allowedMediaTypes' => array_map(fn ($type) => $type->value, $account->platform->allowedMediaTypes()), + 'supportsTextOnly' => $account->platform->supportsTextOnly(), + ], + ]); + + $pinterestBoards = []; + $pinterestAccount = $socialAccounts->firstWhere('platform', Platform::Pinterest); + if ($pinterestAccount) { + try { + $pinterestBoards = app(PinterestPublisher::class)->getBoards($pinterestAccount); + } catch (\Exception $e) { + // Silently fail - boards will be empty + } + } + + return Inertia::render('posts/Edit', [ + 'workspace' => $workspace, + 'post' => $post, + 'socialAccounts' => $socialAccounts, + 'platformConfigs' => $platformConfigs, + 'pinterestBoards' => $pinterestBoards, + 'labels' => $labels, + 'hashtags' => $hashtags, + ]); + } + + public function update(UpdatePostRequest $request, Post $post): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($post->workspace_id !== $workspace->id) { + abort(404); + } + + $result = UpdatePost::execute($workspace, $post, $request->validated()); + + $action = data_get($result, 'action'); + + if ($action === 'already_published') { + session()->flash('flash.banner', __('posts.flash.cannot_edit_published')); + session()->flash('flash.bannerStyle', 'danger'); + + return back(); + } + + if ($action === 'publishing') { + session()->flash('flash.banner', __('posts.flash.publishing')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.posts.edit', $post); + } + + if ($action === 'scheduled') { + session()->flash('flash.banner', __('posts.flash.scheduled')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.posts.edit', $post); + } + + return back(); + } + + public function destroy(Request $request, Post $post): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($post->workspace_id !== $workspace->id) { + abort(404); + } + + DeletePost::execute($post); + + session()->flash('flash.banner', __('posts.flash.deleted')); + session()->flash('flash.bannerStyle', 'success'); + + if ($redirect = $request->input('redirect')) { + return redirect()->route($redirect); + } + + return back(); + } +} diff --git a/app/Http/Controllers/App/Settings/PasswordController.php b/app/Http/Controllers/App/Settings/PasswordController.php new file mode 100644 index 00000000..afbb14a7 --- /dev/null +++ b/app/Http/Controllers/App/Settings/PasswordController.php @@ -0,0 +1,38 @@ +validate([ + 'current_password' => ['required', 'current_password'], + 'password' => ['required', Password::defaults(), 'confirmed'], + ]); + + $request->user()->update([ + 'password' => Hash::make($validated['password']), + ]); + + session()->flash('flash.banner', __('settings.flash.password_updated')); + session()->flash('flash.bannerStyle', 'success'); + + return back(); + } +} diff --git a/app/Http/Controllers/App/Settings/ProfileController.php b/app/Http/Controllers/App/Settings/ProfileController.php new file mode 100644 index 00000000..838c6f26 --- /dev/null +++ b/app/Http/Controllers/App/Settings/ProfileController.php @@ -0,0 +1,105 @@ + $request->user() instanceof MustVerifyEmail, + 'status' => $request->session()->get('status'), + ]); + } + + public function update(ProfileUpdateRequest $request): RedirectResponse + { + $request->user()->fill($request->validated()); + + if ($request->user()->isDirty('email')) { + $request->user()->email_verified_at = null; + } + + $request->user()->save(); + + session()->flash('flash.banner', __('settings.flash.profile_updated')); + session()->flash('flash.bannerStyle', 'success'); + + return to_route('app.profile.edit'); + } + + public function updateLanguage(Request $request): RedirectResponse + { + $request->validate([ + 'language_id' => ['required', 'exists:languages,id'], + ]); + + $request->user()->update([ + 'language_id' => $request->language_id, + ]); + + $request->user()->refresh(); + + session()->flash('flash.banner', __('settings.flash.language_updated')); + session()->flash('flash.bannerStyle', 'success'); + + return back(); + } + + public function destroy(ProfileDeleteRequest $request): RedirectResponse + { + $user = $request->user(); + + DB::transaction(function () use ($user) { + if ($user->subscribed('default')) { + $user->subscription('default')->cancelNow(); + } + $user->subscriptions()->delete(); + $user->update(['current_workspace_id' => null]); + + $ownedWorkspaces = $user->workspaces()->wherePivot('role', Role::Owner->value)->get(); + + foreach ($ownedWorkspaces as $workspace) { + foreach ($workspace->members as $member) { + if ($member->id !== $user->id && $member->current_workspace_id === $workspace->id) { + $otherWorkspace = $member->workspaces() + ->where('workspaces.id', '!=', $workspace->id) + ->first(); + $member->update(['current_workspace_id' => $otherWorkspace?->id]); + } + } + + $workspace->posts()->delete(); + $workspace->socialAccounts()->delete(); + $workspace->hashtags()->delete(); + $workspace->labels()->delete(); + $workspace->invites()->delete(); + $workspace->members()->detach(); + $workspace->delete(); + } + + $user->workspaces()->detach(); + }); + + Auth::logout(); + $user->delete(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return redirect('/'); + } +} diff --git a/app/Http/Controllers/App/WorkspaceController.php b/app/Http/Controllers/App/WorkspaceController.php new file mode 100644 index 00000000..d94d39dc --- /dev/null +++ b/app/Http/Controllers/App/WorkspaceController.php @@ -0,0 +1,125 @@ +user(); + + $workspaces = $user->workspaces() + ->withCount(['socialAccounts', 'posts']) + ->latest() + ->get(); + + return Inertia::render('workspaces/Index', [ + 'workspaces' => $workspaces, + 'currentWorkspaceId' => $user->current_workspace_id, + ]); + } + + public function create(Request $request): Response|RedirectResponse + { + $user = $request->user(); + + if ($user->ownedWorkspacesCount() > 0 && ! $user->hasActiveSubscription()) { + return redirect()->route('app.billing.index') + ->with('message', 'Subscribe to create more workspaces.'); + } + + return Inertia::render('workspaces/Create'); + } + + public function store(StoreWorkspaceRequest $request): RedirectResponse + { + $user = $request->user(); + + if ($user->ownedWorkspacesCount() > 0 && ! $user->hasActiveSubscription()) { + return redirect()->route('app.billing.index') + ->with('message', 'Subscribe to create more workspaces.'); + } + + CreateWorkspace::execute($user, $request->validated()); + + return redirect()->route('app.calendar') + ->with('success', 'Workspace created successfully!'); + } + + public function switch(Request $request, Workspace $workspace): RedirectResponse + { + $user = $request->user(); + + if (! $user->belongsToWorkspace($workspace)) { + abort(403); + } + + $user->switchWorkspace($workspace); + + return redirect()->route('app.calendar'); + } + + public function settings(Request $request): Response|RedirectResponse + { + $user = $request->user(); + $workspace = $user->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('update', $workspace); + + $timezones = collect(timezone_identifiers_list()) + ->mapWithKeys(fn ($tz) => [$tz => $tz]) + ->toArray(); + + return Inertia::render('settings/Workspace', [ + 'workspace' => $workspace, + 'timezones' => $timezones, + ]); + } + + public function updateSettings(UpdateWorkspaceRequest $request): RedirectResponse + { + $user = $request->user(); + $workspace = $user->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('update', $workspace); + + $workspace->update($request->validated()); + + session()->flash('flash.banner', __('settings.flash.workspace_updated')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.workspace.settings'); + } + + public function destroy(Request $request, Workspace $workspace): RedirectResponse + { + $this->authorize('delete', $workspace); + + $user = $request->user(); + + DeleteWorkspace::execute($user, $workspace); + + return redirect()->route('app.workspaces.index') + ->with('success', 'Workspace deleted successfully!'); + } +} diff --git a/app/Http/Controllers/App/WorkspaceHashtagController.php b/app/Http/Controllers/App/WorkspaceHashtagController.php new file mode 100644 index 00000000..1da673f0 --- /dev/null +++ b/app/Http/Controllers/App/WorkspaceHashtagController.php @@ -0,0 +1,105 @@ +user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + return Inertia::render('hashtags/Index', [ + 'workspace' => $workspace, + 'hashtags' => $workspace->hashtags()->latest()->get(), + ]); + } + + public function store(Request $request): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'hashtags' => ['required', 'string'], + ]); + + CreateHashtag::execute($workspace, $validated); + + session()->flash('flash.banner', __('hashtags.flash.created')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.hashtags.index'); + } + + public function update(Request $request, WorkspaceHashtag $hashtag): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($hashtag->workspace_id !== $workspace->id) { + abort(404); + } + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'hashtags' => ['required', 'string'], + ]); + + UpdateHashtag::execute($hashtag, $validated); + + session()->flash('flash.banner', __('hashtags.flash.updated')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.hashtags.index'); + } + + public function destroy(Request $request, WorkspaceHashtag $hashtag): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($hashtag->workspace_id !== $workspace->id) { + abort(404); + } + + DeleteHashtag::execute($hashtag); + + session()->flash('flash.banner', __('hashtags.flash.deleted')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.hashtags.index'); + } +} diff --git a/app/Http/Controllers/App/WorkspaceInviteController.php b/app/Http/Controllers/App/WorkspaceInviteController.php new file mode 100644 index 00000000..36ca8905 --- /dev/null +++ b/app/Http/Controllers/App/WorkspaceInviteController.php @@ -0,0 +1,136 @@ +user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('manageTeam', $workspace); + + return Inertia::render('settings/Members', [ + 'workspace' => $workspace, + 'invites' => $workspace->invites() + ->latest() + ->get(), + 'members' => $workspace->members() + ->where('user_id', '!=', $workspace->user_id) + ->get() + ->map(fn ($member) => [ + 'id' => $member->id, + 'name' => $member->name, + 'email' => $member->email, + 'role' => $member->pivot->role, + ]), + 'owner' => [ + 'id' => $workspace->owner->id, + 'name' => $workspace->owner->name, + 'email' => $workspace->owner->email, + 'role' => WorkspaceRole::Owner->value, + ], + 'roles' => collect(WorkspaceRole::cases()) + ->filter(fn ($role) => $role !== WorkspaceRole::Owner) + ->map(fn ($role) => [ + 'value' => $role->value, + 'label' => $role->label(), + ])->values(), + ]); + } + + public function store(StoreWorkspaceInviteRequest $request): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('manageTeam', $workspace); + + $existingInvite = $workspace->invites() + ->where('email', $request->email) + ->first(); + + if ($existingInvite) { + return back()->withErrors([ + 'email' => 'An invite already exists for this email.', + ]); + } + + if ($workspace->members()->where('email', $request->email)->exists()) { + return back()->withErrors([ + 'email' => 'This user is already a member of the workspace.', + ]); + } + + CreateInvite::execute($workspace, $request->validated()); + + session()->flash('flash.banner', __('settings.members.flash.invite_sent')); + session()->flash('flash.bannerStyle', 'success'); + + return back(); + } + + public function destroy(Request $request, WorkspaceInvite $invite): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('manageTeam', $workspace); + + if ($invite->workspace_id !== $workspace->id) { + abort(404); + } + + DeleteInvite::execute($invite); + + session()->flash('flash.banner', __('settings.members.flash.invite_deleted')); + session()->flash('flash.bannerStyle', 'success'); + + return back(); + } + + public function removeMember(Request $request, string $userId): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('manageTeam', $workspace); + + if ($workspace->user_id === $userId) { + return back()->withErrors(['member' => 'Cannot remove the workspace owner.']); + } + + RemoveMember::execute($workspace, $userId); + + session()->flash('flash.banner', __('settings.members.flash.member_removed')); + session()->flash('flash.bannerStyle', 'success'); + + return back(); + } +} diff --git a/app/Http/Controllers/App/WorkspaceLabelController.php b/app/Http/Controllers/App/WorkspaceLabelController.php new file mode 100644 index 00000000..44cc0f71 --- /dev/null +++ b/app/Http/Controllers/App/WorkspaceLabelController.php @@ -0,0 +1,105 @@ +user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + return Inertia::render('labels/Index', [ + 'workspace' => $workspace, + 'labels' => $workspace->labels()->latest()->get(), + ]); + } + + public function store(Request $request): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], + ]); + + CreateLabel::execute($workspace, $validated); + + session()->flash('flash.banner', __('labels.flash.created')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.labels.index'); + } + + public function update(Request $request, WorkspaceLabel $label): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($label->workspace_id !== $workspace->id) { + abort(404); + } + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], + ]); + + UpdateLabel::execute($label, $validated); + + session()->flash('flash.banner', __('labels.flash.updated')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.labels.index'); + } + + public function destroy(Request $request, WorkspaceLabel $label): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('view', $workspace); + + if ($label->workspace_id !== $workspace->id) { + abort(404); + } + + DeleteLabel::execute($label); + + session()->flash('flash.banner', __('labels.flash.deleted')); + session()->flash('flash.bannerStyle', 'success'); + + return redirect()->route('app.labels.index'); + } +} diff --git a/app/Http/Controllers/Auth/AcceptInviteController.php b/app/Http/Controllers/Auth/AcceptInviteController.php index 4ae3ebf5..cc960fe4 100644 --- a/app/Http/Controllers/Auth/AcceptInviteController.php +++ b/app/Http/Controllers/Auth/AcceptInviteController.php @@ -48,7 +48,7 @@ public function accept(Request $request, WorkspaceInvite $invite): RedirectRespo session()->flash('flash.banner', __('settings.members.flash.wrong_email')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('calendar'); + return redirect()->route('app.calendar'); } // Check if already a member @@ -58,7 +58,7 @@ public function accept(Request $request, WorkspaceInvite $invite): RedirectRespo session()->flash('flash.banner', __('settings.members.flash.already_member')); session()->flash('flash.bannerStyle', 'info'); - return redirect()->route('calendar'); + return redirect()->route('app.calendar'); } // Accept the invite @@ -69,7 +69,7 @@ public function accept(Request $request, WorkspaceInvite $invite): RedirectRespo session()->flash('flash.banner', __('settings.members.flash.invite_accepted')); session()->flash('flash.bannerStyle', 'success'); - return redirect()->route('calendar'); + return redirect()->route('app.calendar'); } /** @@ -84,7 +84,7 @@ public function decline(Request $request, WorkspaceInvite $invite): RedirectResp session()->flash('flash.banner', __('settings.members.flash.wrong_email')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('calendar'); + return redirect()->route('app.calendar'); } $invite->delete(); @@ -92,6 +92,6 @@ public function decline(Request $request, WorkspaceInvite $invite): RedirectResp session()->flash('flash.banner', __('settings.members.flash.invite_declined')); session()->flash('flash.bannerStyle', 'info'); - return redirect()->route('calendar'); + return redirect()->route('app.calendar'); } } diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php index a93a85d1..c3ce6dd6 100644 --- a/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ b/app/Http/Controllers/Auth/AuthenticatedSessionController.php @@ -40,7 +40,7 @@ public function store(LoginRequest $request): RedirectResponse return redirect($redirect); } - return redirect()->intended(route('calendar')); + return redirect()->intended(route('app.calendar')); } /** diff --git a/app/Http/Controllers/Auth/BlueskyController.php b/app/Http/Controllers/Auth/BlueskyController.php index 68d03180..1ed869b7 100644 --- a/app/Http/Controllers/Auth/BlueskyController.php +++ b/app/Http/Controllers/Auth/BlueskyController.php @@ -23,7 +23,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); @@ -45,7 +45,7 @@ public function store(Request $request): View|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); diff --git a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php b/app/Http/Controllers/Auth/EmailVerificationNotificationController.php index bc769e67..4b28463b 100644 --- a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php +++ b/app/Http/Controllers/Auth/EmailVerificationNotificationController.php @@ -16,7 +16,7 @@ class EmailVerificationNotificationController extends Controller public function store(Request $request): RedirectResponse { if ($request->user()->hasVerifiedEmail()) { - return redirect()->intended(route('calendar')); + return redirect()->intended(route('app.calendar')); } $request->user()->sendEmailVerificationNotification(); diff --git a/app/Http/Controllers/Auth/EmailVerificationPromptController.php b/app/Http/Controllers/Auth/EmailVerificationPromptController.php index 6364157f..01645504 100644 --- a/app/Http/Controllers/Auth/EmailVerificationPromptController.php +++ b/app/Http/Controllers/Auth/EmailVerificationPromptController.php @@ -18,7 +18,7 @@ class EmailVerificationPromptController extends Controller public function __invoke(Request $request): RedirectResponse|Response { return $request->user()->hasVerifiedEmail() - ? redirect()->intended(route('calendar')) + ? redirect()->intended(route('app.calendar')) : Inertia::render('auth/VerifyEmail', [ 'status' => session('status'), ]); diff --git a/app/Http/Controllers/Auth/FacebookController.php b/app/Http/Controllers/Auth/FacebookController.php index 16972390..0982e7db 100644 --- a/app/Http/Controllers/Auth/FacebookController.php +++ b/app/Http/Controllers/Auth/FacebookController.php @@ -34,7 +34,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); @@ -159,7 +159,7 @@ public function callback(Request $request): View|RedirectResponse ], ]); - return redirect()->route('social.facebook.select-page'); + return redirect()->route('app.social.facebook.select-page'); } catch (\Exception $e) { Log::error('Facebook OAuth Error', [ 'error' => $e->getMessage(), @@ -179,7 +179,7 @@ public function selectPage(Request $request) session()->flash('flash.banner', __('accounts.flash.session_expired')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('accounts'); + return redirect()->route('app.accounts'); } $workspace = Workspace::find($workspaceId); @@ -188,7 +188,7 @@ public function selectPage(Request $request) session()->flash('flash.banner', __('accounts.flash.workspace_not_found')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('accounts'); + return redirect()->route('app.accounts'); } return Inertia::render('accounts/FacebookPageSelect', [ diff --git a/app/Http/Controllers/Auth/InstagramController.php b/app/Http/Controllers/Auth/InstagramController.php index d26473ca..063565b3 100644 --- a/app/Http/Controllers/Auth/InstagramController.php +++ b/app/Http/Controllers/Auth/InstagramController.php @@ -31,7 +31,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); diff --git a/app/Http/Controllers/Auth/LinkedInController.php b/app/Http/Controllers/Auth/LinkedInController.php index 89413d4b..9bf1eb51 100644 --- a/app/Http/Controllers/Auth/LinkedInController.php +++ b/app/Http/Controllers/Auth/LinkedInController.php @@ -34,7 +34,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); diff --git a/app/Http/Controllers/Auth/LinkedInPageController.php b/app/Http/Controllers/Auth/LinkedInPageController.php index 6b151cea..1798f1d6 100644 --- a/app/Http/Controllers/Auth/LinkedInPageController.php +++ b/app/Http/Controllers/Auth/LinkedInPageController.php @@ -39,7 +39,7 @@ public function connect(Request $request): SymfonyResponse|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); @@ -116,7 +116,7 @@ public function callback(Request $request): View|RedirectResponse ], ]); - return redirect()->route('social.linkedin-page.select-page'); + return redirect()->route('app.social.linkedin-page.select-page'); } catch (\Exception $e) { Log::error('LinkedIn Page OAuth Error', [ 'error' => $e->getMessage(), @@ -134,7 +134,7 @@ public function selectPage(Request $request): Response|RedirectResponse session()->flash('flash.banner', __('accounts.flash.session_expired')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('accounts'); + return redirect()->route('app.accounts'); } $workspace = Workspace::find($pendingData['workspace_id']); @@ -143,7 +143,7 @@ public function selectPage(Request $request): Response|RedirectResponse session()->flash('flash.banner', __('accounts.flash.workspace_not_found')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('accounts'); + return redirect()->route('app.accounts'); } return Inertia::render('accounts/LinkedInPageSelect', [ diff --git a/app/Http/Controllers/Auth/MastodonController.php b/app/Http/Controllers/Auth/MastodonController.php index 6613b2c8..1c2cef18 100644 --- a/app/Http/Controllers/Auth/MastodonController.php +++ b/app/Http/Controllers/Auth/MastodonController.php @@ -30,7 +30,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); @@ -54,7 +54,7 @@ public function authorizeInstance(Request $request): SymfonyResponse|RedirectRes $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); @@ -65,7 +65,7 @@ public function authorizeInstance(Request $request): SymfonyResponse|RedirectRes // Register app on the instance $appResponse = Http::post("{$instance}/api/v1/apps", [ 'client_name' => config('app.name'), - 'redirect_uris' => route('social.mastodon.callback'), + 'redirect_uris' => route('app.social.mastodon.callback'), 'scopes' => self::SCOPES, 'website' => config('app.url'), ]); @@ -96,7 +96,7 @@ public function authorizeInstance(Request $request): SymfonyResponse|RedirectRes $params = http_build_query([ 'client_id' => $app['client_id'], 'response_type' => 'code', - 'redirect_uri' => route('social.mastodon.callback'), + 'redirect_uri' => route('app.social.mastodon.callback'), 'scope' => self::SCOPES, 'state' => $state, ]); @@ -149,7 +149,7 @@ public function callback(Request $request): View 'grant_type' => 'authorization_code', 'client_id' => $clientId, 'client_secret' => $clientSecret, - 'redirect_uri' => route('social.mastodon.callback'), + 'redirect_uri' => route('app.social.mastodon.callback'), 'code' => $request->code, ]); diff --git a/app/Http/Controllers/Auth/PinterestController.php b/app/Http/Controllers/Auth/PinterestController.php index 4f335947..2eea1235 100644 --- a/app/Http/Controllers/Auth/PinterestController.php +++ b/app/Http/Controllers/Auth/PinterestController.php @@ -33,7 +33,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 85284ffb..95672836 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -6,10 +6,10 @@ use App\Enums\User\Setup; use App\Http\Controllers\Controller; -use App\Rules\Timezone; use App\Models\Language; use App\Models\User; use App\Models\Workspace; +use App\Rules\Timezone; use Illuminate\Auth\Events\Registered; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; @@ -84,6 +84,6 @@ public function store(Request $request): RedirectResponse return redirect($redirect); } - return redirect()->route('onboarding.step1'); + return redirect()->route('app.onboarding.step1'); } } diff --git a/app/Http/Controllers/Auth/SocialController.php b/app/Http/Controllers/Auth/SocialController.php index f65737e5..42dbf9dd 100644 --- a/app/Http/Controllers/Auth/SocialController.php +++ b/app/Http/Controllers/Auth/SocialController.php @@ -32,7 +32,7 @@ public function index(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('view', $workspace); @@ -62,7 +62,7 @@ public function disconnect(Request $request, SocialAccount $account): RedirectRe $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); @@ -84,7 +84,7 @@ protected function redirectToProvider(Request $request, string $driver, array $s $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } session(['social_connect_workspace' => $workspace->id]); diff --git a/app/Http/Controllers/Auth/ThreadsController.php b/app/Http/Controllers/Auth/ThreadsController.php index d5a61b9c..1653c8d8 100644 --- a/app/Http/Controllers/Auth/ThreadsController.php +++ b/app/Http/Controllers/Auth/ThreadsController.php @@ -29,7 +29,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); diff --git a/app/Http/Controllers/Auth/TikTokController.php b/app/Http/Controllers/Auth/TikTokController.php index 597a6cf5..5cd3e725 100644 --- a/app/Http/Controllers/Auth/TikTokController.php +++ b/app/Http/Controllers/Auth/TikTokController.php @@ -31,7 +31,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); diff --git a/app/Http/Controllers/Auth/VerifyEmailController.php b/app/Http/Controllers/Auth/VerifyEmailController.php index 567e31d6..aa17b64e 100644 --- a/app/Http/Controllers/Auth/VerifyEmailController.php +++ b/app/Http/Controllers/Auth/VerifyEmailController.php @@ -17,13 +17,13 @@ class VerifyEmailController extends Controller public function __invoke(EmailVerificationRequest $request): RedirectResponse { if ($request->user()->hasVerifiedEmail()) { - return redirect()->intended(route('calendar').'?verified=1'); + return redirect()->intended(route('app.calendar').'?verified=1'); } if ($request->user()->markEmailAsVerified()) { event(new Verified($request->user())); } - return redirect()->intended(route('calendar').'?verified=1'); + return redirect()->intended(route('app.calendar').'?verified=1'); } } diff --git a/app/Http/Controllers/Auth/XController.php b/app/Http/Controllers/Auth/XController.php index 481dc998..10b94f3a 100644 --- a/app/Http/Controllers/Auth/XController.php +++ b/app/Http/Controllers/Auth/XController.php @@ -29,7 +29,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); diff --git a/app/Http/Controllers/Auth/YouTubeController.php b/app/Http/Controllers/Auth/YouTubeController.php index e5e07c74..f81ecaf7 100644 --- a/app/Http/Controllers/Auth/YouTubeController.php +++ b/app/Http/Controllers/Auth/YouTubeController.php @@ -7,8 +7,10 @@ use App\Models\Workspace; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Log; use Illuminate\View\View; +use Inertia\Inertia; use Laravel\Socialite\Facades\Socialite; use Symfony\Component\HttpFoundation\Response; @@ -31,7 +33,7 @@ public function connect(Request $request): Response|RedirectResponse $workspace = $request->user()->currentWorkspace; if (! $workspace) { - return redirect()->route('workspaces.create'); + return redirect()->route('app.workspaces.create'); } $this->authorize('manageAccounts', $workspace); @@ -150,7 +152,7 @@ public function callback(Request $request): View|RedirectResponse ], ]); - return redirect()->route('social.youtube.select-channel'); + return redirect()->route('app.social.youtube.select-channel'); } catch (\Exception $e) { Log::error('YouTube OAuth Error', [ 'error' => $e->getMessage(), @@ -170,7 +172,7 @@ public function selectChannel(Request $request) session()->flash('flash.banner', __('accounts.flash.session_expired')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('accounts'); + return redirect()->route('app.accounts'); } $workspace = Workspace::find($workspaceId); @@ -179,7 +181,7 @@ public function selectChannel(Request $request) session()->flash('flash.banner', __('accounts.flash.workspace_not_found')); session()->flash('flash.bannerStyle', 'danger'); - return redirect()->route('accounts'); + return redirect()->route('app.accounts'); } // Fetch YouTube channels @@ -291,7 +293,7 @@ public function select(Request $request): View private function redirectToGoogle(): Response { - return \Inertia\Inertia::location( + return Inertia::location( Socialite::driver($this->driver) ->scopes($this->scopes) ->with([ @@ -307,7 +309,7 @@ private function redirectToGoogle(): Response private function fetchChannels(string $accessToken): array { try { - $response = \Illuminate\Support\Facades\Http::withToken($accessToken) + $response = Http::withToken($accessToken) ->get('https://www.googleapis.com/youtube/v3/channels', [ 'part' => 'snippet,contentDetails,statistics', 'mine' => 'true', diff --git a/app/Http/Middleware/Api/AuthenticateApiToken.php b/app/Http/Middleware/Api/AuthenticateApiToken.php new file mode 100644 index 00000000..17cec3bf --- /dev/null +++ b/app/Http/Middleware/Api/AuthenticateApiToken.php @@ -0,0 +1,47 @@ +bearerToken(); + + if (! $token) { + return response()->json(['message' => 'Missing API key.'], Response::HTTP_UNAUTHORIZED); + } + + if (! str_starts_with($token, 'tp_') || strlen($token) !== 51) { + return response()->json(['message' => 'Invalid API key.'], Response::HTTP_UNAUTHORIZED); + } + + $lookup = substr($token, 3, 16); + $apiToken = ApiToken::where('token_lookup', $lookup)->first(); + + if (! $apiToken || ! Hash::check($token, $apiToken->token_hash)) { + return response()->json(['message' => 'Invalid API key.'], Response::HTTP_UNAUTHORIZED); + } + + if ($apiToken->status === 'expired') { + return response()->json(['message' => 'API key has expired.'], Response::HTTP_UNAUTHORIZED); + } + + $apiToken->update(['last_used_at' => now()]); + + $request->merge([ + 'workspace' => $apiToken->workspace, + 'api_token' => $apiToken, + ]); + + return $next($request); + } +} diff --git a/app/Http/Middleware/EnsureSubscribed.php b/app/Http/Middleware/EnsureSubscribed.php index 8558d87d..e5e5ec29 100644 --- a/app/Http/Middleware/EnsureSubscribed.php +++ b/app/Http/Middleware/EnsureSubscribed.php @@ -11,7 +11,7 @@ class EnsureSubscribed /** * Handle an incoming request. * - * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next + * @param Closure(Request): (Response) $next */ public function handle(Request $request, Closure $next): Response { @@ -43,6 +43,6 @@ public function handle(Request $request, Closure $next): Response } // Redirect to subscription page - return redirect()->route('subscribe'); + return redirect()->route('app.subscribe'); } } diff --git a/app/Http/Middleware/EnsureUserSetupIsComplete.php b/app/Http/Middleware/EnsureUserSetupIsComplete.php index 17ba7e3b..2ad31d90 100644 --- a/app/Http/Middleware/EnsureUserSetupIsComplete.php +++ b/app/Http/Middleware/EnsureUserSetupIsComplete.php @@ -12,7 +12,7 @@ class EnsureUserSetupIsComplete /** * Handle an incoming request. * - * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next + * @param Closure(Request): (Response) $next */ public function handle(Request $request, Closure $next): Response { @@ -46,10 +46,10 @@ public function handle(Request $request, Closure $next): Response // Redirect to appropriate step return match ($user->setup) { - Setup::Role => redirect()->route('onboarding.step1'), - Setup::Connections => redirect()->route('onboarding.step2'), - Setup::Subscription => redirect()->route('onboarding.step2'), - default => redirect()->route('onboarding.step1'), + Setup::Role => redirect()->route('app.onboarding.step1'), + Setup::Connections => redirect()->route('app.onboarding.step2'), + Setup::Subscription => redirect()->route('app.onboarding.step2'), + default => redirect()->route('app.onboarding.step1'), }; } } diff --git a/app/Http/Middleware/HandleAppearance.php b/app/Http/Middleware/HandleAppearance.php index f1a02bbc..1a01684d 100644 --- a/app/Http/Middleware/HandleAppearance.php +++ b/app/Http/Middleware/HandleAppearance.php @@ -12,7 +12,7 @@ class HandleAppearance /** * Handle an incoming request. * - * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next + * @param Closure(Request): (Response) $next */ public function handle(Request $request, Closure $next): Response { diff --git a/app/Http/Requests/Api/ApiKey/StoreApiKeyRequest.php b/app/Http/Requests/Api/ApiKey/StoreApiKeyRequest.php new file mode 100644 index 00000000..404a552e --- /dev/null +++ b/app/Http/Requests/Api/ApiKey/StoreApiKeyRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'expires_at' => ['nullable', 'date', 'after:today'], + ]; + } +} diff --git a/app/Http/Requests/Api/Hashtag/StoreHashtagRequest.php b/app/Http/Requests/Api/Hashtag/StoreHashtagRequest.php new file mode 100644 index 00000000..7e3ac266 --- /dev/null +++ b/app/Http/Requests/Api/Hashtag/StoreHashtagRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'hashtags' => ['required', 'string'], + ]; + } +} diff --git a/app/Http/Requests/Api/Hashtag/UpdateHashtagRequest.php b/app/Http/Requests/Api/Hashtag/UpdateHashtagRequest.php new file mode 100644 index 00000000..15b48407 --- /dev/null +++ b/app/Http/Requests/Api/Hashtag/UpdateHashtagRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'hashtags' => ['required', 'string'], + ]; + } +} diff --git a/app/Http/Requests/Api/Label/StoreLabelRequest.php b/app/Http/Requests/Api/Label/StoreLabelRequest.php new file mode 100644 index 00000000..eb30d954 --- /dev/null +++ b/app/Http/Requests/Api/Label/StoreLabelRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], + ]; + } +} diff --git a/app/Http/Requests/Api/Label/UpdateLabelRequest.php b/app/Http/Requests/Api/Label/UpdateLabelRequest.php new file mode 100644 index 00000000..9cc9532e --- /dev/null +++ b/app/Http/Requests/Api/Label/UpdateLabelRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], + ]; + } +} diff --git a/app/Http/Requests/App/ApiKey/StoreApiKeyRequest.php b/app/Http/Requests/App/ApiKey/StoreApiKeyRequest.php new file mode 100644 index 00000000..b4f881ca --- /dev/null +++ b/app/Http/Requests/App/ApiKey/StoreApiKeyRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'expires_at' => ['nullable', 'date', 'after:today'], + ]; + } +} diff --git a/app/Http/Requests/App/Hashtag/StoreHashtagRequest.php b/app/Http/Requests/App/Hashtag/StoreHashtagRequest.php new file mode 100644 index 00000000..860be3bd --- /dev/null +++ b/app/Http/Requests/App/Hashtag/StoreHashtagRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'hashtags' => ['required', 'string'], + ]; + } +} diff --git a/app/Http/Requests/App/Label/StoreLabelRequest.php b/app/Http/Requests/App/Label/StoreLabelRequest.php new file mode 100644 index 00000000..8f8d9d13 --- /dev/null +++ b/app/Http/Requests/App/Label/StoreLabelRequest.php @@ -0,0 +1,26 @@ + + */ + public function rules(): array + { + return [ + 'name' => ['required', 'string', 'max:255'], + 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], + ]; + } +} diff --git a/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/Auth/LoginRequest.php index 7befcea5..db82457c 100644 --- a/app/Http/Requests/Auth/LoginRequest.php +++ b/app/Http/Requests/Auth/LoginRequest.php @@ -5,6 +5,7 @@ namespace App\Http\Requests\Auth; use Illuminate\Auth\Events\Lockout; +use Illuminate\Contracts\Validation\Rule; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\RateLimiter; @@ -24,7 +25,7 @@ public function authorize(): bool /** * Get the validation rules that apply to the request. * - * @return array + * @return array */ public function rules(): array { @@ -37,7 +38,7 @@ public function rules(): array /** * Attempt to authenticate the request's credentials. * - * @throws \Illuminate\Validation\ValidationException + * @throws ValidationException */ public function authenticate(): void { @@ -57,7 +58,7 @@ public function authenticate(): void /** * Ensure the login request is not rate limited. * - * @throws \Illuminate\Validation\ValidationException + * @throws ValidationException */ public function ensureIsNotRateLimited(): void { diff --git a/app/Http/Requests/StoreWorkspaceInviteRequest.php b/app/Http/Requests/StoreWorkspaceInviteRequest.php index 73d549aa..f5027daa 100644 --- a/app/Http/Requests/StoreWorkspaceInviteRequest.php +++ b/app/Http/Requests/StoreWorkspaceInviteRequest.php @@ -3,6 +3,7 @@ namespace App\Http\Requests; use App\Enums\UserWorkspace\Role as WorkspaceRole; +use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; @@ -19,7 +20,7 @@ public function authorize(): bool /** * Get the validation rules that apply to the request. * - * @return array|string> + * @return array|string> */ public function rules(): array { diff --git a/app/Http/Resources/Api/ApiKeyResource.php b/app/Http/Resources/Api/ApiKeyResource.php new file mode 100644 index 00000000..e574c2a9 --- /dev/null +++ b/app/Http/Resources/Api/ApiKeyResource.php @@ -0,0 +1,27 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'key_hint' => $this->key_hint, + 'status' => $this->status, + 'last_used_at' => $this->last_used_at?->format('Y-m-d H:i:s'), + 'expires_at' => $this->expires_at?->format('Y-m-d H:i:s'), + 'created_at' => $this->created_at->format('Y-m-d H:i:s'), + ]; + } +} diff --git a/app/Http/Resources/Api/HashtagResource.php b/app/Http/Resources/Api/HashtagResource.php new file mode 100644 index 00000000..85ade0c5 --- /dev/null +++ b/app/Http/Resources/Api/HashtagResource.php @@ -0,0 +1,25 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'hashtags' => $this->hashtags, + 'created_at' => $this->created_at->format('Y-m-d H:i:s'), + 'updated_at' => $this->updated_at->format('Y-m-d H:i:s'), + ]; + } +} diff --git a/app/Http/Resources/Api/LabelResource.php b/app/Http/Resources/Api/LabelResource.php new file mode 100644 index 00000000..b35a6eb5 --- /dev/null +++ b/app/Http/Resources/Api/LabelResource.php @@ -0,0 +1,25 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'color' => $this->color, + 'created_at' => $this->created_at->format('Y-m-d H:i:s'), + 'updated_at' => $this->updated_at->format('Y-m-d H:i:s'), + ]; + } +} diff --git a/app/Http/Resources/Api/PostPlatformResource.php b/app/Http/Resources/Api/PostPlatformResource.php new file mode 100644 index 00000000..b8939cab --- /dev/null +++ b/app/Http/Resources/Api/PostPlatformResource.php @@ -0,0 +1,27 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'platform' => $this->platform, + 'content' => $this->content, + 'content_type' => $this->content_type, + 'status' => $this->status, + 'enabled' => $this->enabled, + 'social_account' => new SocialAccountResource($this->whenLoaded('socialAccount')), + ]; + } +} diff --git a/app/Http/Resources/Api/PostResource.php b/app/Http/Resources/Api/PostResource.php new file mode 100644 index 00000000..34063b40 --- /dev/null +++ b/app/Http/Resources/Api/PostResource.php @@ -0,0 +1,29 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'status' => $this->status, + 'synced' => $this->synced, + 'scheduled_at' => $this->scheduled_at?->format('Y-m-d H:i:s'), + 'published_at' => $this->published_at?->format('Y-m-d H:i:s'), + 'platforms' => PostPlatformResource::collection($this->whenLoaded('postPlatforms')), + 'labels' => LabelResource::collection($this->whenLoaded('labels')), + 'created_at' => $this->created_at->format('Y-m-d H:i:s'), + 'updated_at' => $this->updated_at->format('Y-m-d H:i:s'), + ]; + } +} diff --git a/app/Http/Resources/Api/SocialAccountResource.php b/app/Http/Resources/Api/SocialAccountResource.php new file mode 100644 index 00000000..e7438236 --- /dev/null +++ b/app/Http/Resources/Api/SocialAccountResource.php @@ -0,0 +1,25 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'platform' => $this->platform, + 'name' => $this->name, + 'username' => $this->username, + 'avatar' => $this->avatar, + ]; + } +} diff --git a/app/Http/Resources/Api/WorkspaceResource.php b/app/Http/Resources/Api/WorkspaceResource.php new file mode 100644 index 00000000..b8a26f9f --- /dev/null +++ b/app/Http/Resources/Api/WorkspaceResource.php @@ -0,0 +1,25 @@ + + */ + public function toArray(Request $request): array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'timezone' => $this->timezone, + 'created_at' => $this->created_at->format('Y-m-d H:i:s'), + 'updated_at' => $this->updated_at->format('Y-m-d H:i:s'), + ]; + } +} diff --git a/app/Mail/AccountDisconnected.php b/app/Mail/AccountDisconnected.php index 6c3fa747..a5cbf04f 100644 --- a/app/Mail/AccountDisconnected.php +++ b/app/Mail/AccountDisconnected.php @@ -43,7 +43,7 @@ public function content(): Content 'platformName' => $platformName, 'accountName' => $accountName, 'workspaceName' => $workspaceName, - 'url' => route('accounts'), + 'url' => route('app.accounts'), ], ); } diff --git a/app/Mail/WorkspaceConnectionsDisconnected.php b/app/Mail/WorkspaceConnectionsDisconnected.php index 5f764b79..8390f481 100644 --- a/app/Mail/WorkspaceConnectionsDisconnected.php +++ b/app/Mail/WorkspaceConnectionsDisconnected.php @@ -61,7 +61,7 @@ public function content(): Content 'buttonText' => __('mail.workspace_connections_disconnected.button', [], $locale), 'workspace' => $this->workspace, 'disconnectedAccounts' => $this->disconnectedAccounts, - 'url' => route('accounts'), + 'url' => route('app.accounts'), ], ); } diff --git a/app/Mail/WorkspaceInvite.php b/app/Mail/WorkspaceInvite.php index e666f0dc..47df0c7f 100644 --- a/app/Mail/WorkspaceInvite.php +++ b/app/Mail/WorkspaceInvite.php @@ -33,7 +33,7 @@ public function content(): Content 'title' => "You've been invited to join {$this->invite->workspace->name}", 'previewText' => "You've been invited to join {$this->invite->workspace->name}", 'invite' => $this->invite, - 'url' => route('invites.show', $this->invite->id), + 'url' => route('app.invites.show', $this->invite->id), ], ); } diff --git a/app/Models/ApiToken.php b/app/Models/ApiToken.php new file mode 100644 index 00000000..e5dbacdf --- /dev/null +++ b/app/Models/ApiToken.php @@ -0,0 +1,70 @@ + 'datetime', + 'expires_at' => 'datetime', + ]; + } + + public function workspace(): BelongsTo + { + return $this->belongsTo(Workspace::class); + } + + protected function keyHint(): Attribute + { + return Attribute::make( + get: fn () => 'tp_'.substr($this->token_lookup, 0, 8).'...', + ); + } + + protected function status(): Attribute + { + return Attribute::make( + get: function () { + if ($this->expires_at === null) { + return 'active'; + } + + return now()->greaterThan($this->expires_at) ? 'expired' : 'active'; + } + ); + } +} diff --git a/app/Models/Media.php b/app/Models/Media.php index a397147a..33031c0a 100644 --- a/app/Models/Media.php +++ b/app/Models/Media.php @@ -3,6 +3,7 @@ namespace App\Models; use App\Enums\Media\Type as MediaType; +use Database\Factories\MediaFactory; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -12,7 +13,7 @@ class Media extends Model { - /** @use HasFactory<\Database\Factories\MediaFactory> */ + /** @use HasFactory */ use HasFactory, HasUuids; protected $table = 'medias'; diff --git a/app/Models/Post.php b/app/Models/Post.php index bcf89158..46546f50 100644 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -3,6 +3,7 @@ namespace App\Models; use App\Enums\Post\Status as PostStatus; +use Database\Factories\PostFactory; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -13,7 +14,7 @@ class Post extends Model { - /** @use HasFactory<\Database\Factories\PostFactory> */ + /** @use HasFactory */ use HasFactory, HasUuids; protected $fillable = [ diff --git a/app/Models/PostPlatform.php b/app/Models/PostPlatform.php index 95ccee0a..7c6e1f80 100644 --- a/app/Models/PostPlatform.php +++ b/app/Models/PostPlatform.php @@ -5,6 +5,7 @@ use App\Enums\PostPlatform\ContentType; use App\Enums\SocialAccount\Platform as SocialPlatform; use App\Models\Traits\HasMedia; +use Database\Factories\PostPlatformFactory; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -12,7 +13,7 @@ class PostPlatform extends Model { - /** @use HasFactory<\Database\Factories\PostPlatformFactory> */ + /** @use HasFactory */ use HasFactory, HasMedia, HasUuids; protected $fillable = [ diff --git a/app/Models/SocialAccount.php b/app/Models/SocialAccount.php index 2e0b8af7..53157949 100644 --- a/app/Models/SocialAccount.php +++ b/app/Models/SocialAccount.php @@ -5,6 +5,7 @@ use App\Enums\SocialAccount\Platform as SocialPlatform; use App\Enums\SocialAccount\Status; use App\Mail\AccountDisconnected; +use Database\Factories\SocialAccountFactory; use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -17,7 +18,7 @@ class SocialAccount extends Model { - /** @use HasFactory<\Database\Factories\SocialAccountFactory> */ + /** @use HasFactory */ use HasFactory, HasUuids; protected $fillable = [ diff --git a/app/Models/User.php b/app/Models/User.php index 0fbd5e72..180b428d 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -6,6 +6,7 @@ use App\Enums\User\Setup; use App\Models\Traits\HasMedia; use App\Models\Traits\HasWorkspace; +use Database\Factories\UserFactory; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -16,7 +17,7 @@ class User extends Authenticatable implements MustVerifyEmail { - /** @use HasFactory<\Database\Factories\UserFactory> */ + /** @use HasFactory */ use Billable, HasFactory, HasMedia, HasUuids, HasWorkspace, Notifiable; /** diff --git a/app/Models/Workspace.php b/app/Models/Workspace.php index 93e75476..edc275ab 100644 --- a/app/Models/Workspace.php +++ b/app/Models/Workspace.php @@ -3,6 +3,7 @@ namespace App\Models; use App\Models\Traits\HasMedia; +use Database\Factories\WorkspaceFactory; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -12,7 +13,7 @@ class Workspace extends Model { - /** @use HasFactory<\Database\Factories\WorkspaceFactory> */ + /** @use HasFactory */ use HasFactory, HasMedia, HasUuids; protected $fillable = [ @@ -78,6 +79,11 @@ public function labels(): HasMany return $this->hasMany(WorkspaceLabel::class); } + public function apiTokens(): HasMany + { + return $this->hasMany(ApiToken::class); + } + public function hasMember(User $user): bool { return $this->user_id === $user->id || $this->members()->where('user_id', $user->id)->exists(); diff --git a/app/Models/WorkspaceHashtag.php b/app/Models/WorkspaceHashtag.php index 269129d1..b52e9915 100644 --- a/app/Models/WorkspaceHashtag.php +++ b/app/Models/WorkspaceHashtag.php @@ -2,6 +2,7 @@ namespace App\Models; +use Database\Factories\WorkspaceHashtagFactory; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -10,7 +11,7 @@ class WorkspaceHashtag extends Model { - /** @use HasFactory<\Database\Factories\WorkspaceHashtagFactory> */ + /** @use HasFactory */ use HasFactory, HasUuids, SoftDeletes; protected $fillable = [ diff --git a/app/Models/WorkspaceInvite.php b/app/Models/WorkspaceInvite.php index 435149ee..ecf29360 100644 --- a/app/Models/WorkspaceInvite.php +++ b/app/Models/WorkspaceInvite.php @@ -5,6 +5,7 @@ namespace App\Models; use App\Enums\UserWorkspace\Role; +use Database\Factories\WorkspaceInviteFactory; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -12,7 +13,7 @@ class WorkspaceInvite extends Model { - /** @use HasFactory<\Database\Factories\WorkspaceInviteFactory> */ + /** @use HasFactory */ use HasFactory, HasUuids; /** diff --git a/app/Models/WorkspaceLabel.php b/app/Models/WorkspaceLabel.php index 1a74ea88..691bf535 100644 --- a/app/Models/WorkspaceLabel.php +++ b/app/Models/WorkspaceLabel.php @@ -2,6 +2,7 @@ namespace App\Models; +use Database\Factories\WorkspaceLabelFactory; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; @@ -11,7 +12,7 @@ class WorkspaceLabel extends Model { - /** @use HasFactory<\Database\Factories\WorkspaceLabelFactory> */ + /** @use HasFactory */ use HasFactory, HasUuids, SoftDeletes; protected $fillable = [ diff --git a/app/Rules/Timezone.php b/app/Rules/Timezone.php index 90301db0..2432498f 100644 --- a/app/Rules/Timezone.php +++ b/app/Rules/Timezone.php @@ -6,11 +6,12 @@ use Closure; use Illuminate\Contracts\Validation\ValidationRule; +use Illuminate\Translation\PotentiallyTranslatedString; class Timezone implements ValidationRule { /** - * @param \Closure(string, ?string=): \Illuminate\Translation\PotentiallyTranslatedString $fail + * @param Closure(string, ?string=): PotentiallyTranslatedString $fail */ public function validate(string $attribute, mixed $value, Closure $fail): void { diff --git a/bootstrap/app.php b/bootstrap/app.php index cb35c54b..9d575680 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,5 +1,6 @@ withRouting( web: __DIR__.'/../routes/web.php', + api: __DIR__.'/../routes/api.php', + apiPrefix: '', commands: __DIR__.'/../routes/console.php', channels: __DIR__.'/../routes/channels.php', health: '/up', - then: function () { - Route::middleware('web') - ->group(base_path('routes/auth.php')); - }, ) ->withMiddleware(function (Middleware $middleware): void { $middleware->encryptCookies(except: ['appearance', 'sidebar_state']); @@ -31,6 +29,11 @@ $middleware->alias([ 'subscribed' => EnsureSubscribed::class, + 'api.auth' => AuthenticateApiToken::class, + ]); + + $middleware->validateCsrfTokens(except: [ + 'stripe/*', ]); }) ->withExceptions(function (Exceptions $exceptions): void { diff --git a/bootstrap/providers.php b/bootstrap/providers.php index 4e3b4407..2345aa62 100644 --- a/bootstrap/providers.php +++ b/bootstrap/providers.php @@ -1,6 +1,9 @@ [ 'users' => [ 'driver' => 'eloquent', - 'model' => env('AUTH_MODEL', App\Models\User::class), + 'model' => env('AUTH_MODEL', User::class), ], // 'users' => [ diff --git a/config/database.php b/config/database.php index c15e8c4a..ee12bd3d 100644 --- a/config/database.php +++ b/config/database.php @@ -1,6 +1,7 @@ true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - (PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), + (PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], @@ -79,7 +80,7 @@ 'strict' => true, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - (PHP_VERSION_ID >= 80500 ? \Pdo\Mysql::ATTR_SSL_CA : \PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), + (PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], diff --git a/database/factories/LanguageFactory.php b/database/factories/LanguageFactory.php index 318bbe9b..0357c633 100644 --- a/database/factories/LanguageFactory.php +++ b/database/factories/LanguageFactory.php @@ -2,10 +2,11 @@ namespace Database\Factories; +use App\Models\Language; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Language> + * @extends Factory */ class LanguageFactory extends Factory { diff --git a/database/factories/MediaFactory.php b/database/factories/MediaFactory.php index 94c14315..2760ce40 100644 --- a/database/factories/MediaFactory.php +++ b/database/factories/MediaFactory.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Media> + * @extends Factory */ class MediaFactory extends Factory { diff --git a/database/factories/PostFactory.php b/database/factories/PostFactory.php index c5188ec0..1e67d8eb 100644 --- a/database/factories/PostFactory.php +++ b/database/factories/PostFactory.php @@ -3,12 +3,13 @@ namespace Database\Factories; use App\Enums\Post\Status as PostStatus; +use App\Models\Post; use App\Models\User; use App\Models\Workspace; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Post> + * @extends Factory */ class PostFactory extends Factory { diff --git a/database/factories/PostPlatformFactory.php b/database/factories/PostPlatformFactory.php index 95557b2c..a7198162 100644 --- a/database/factories/PostPlatformFactory.php +++ b/database/factories/PostPlatformFactory.php @@ -5,11 +5,12 @@ use App\Enums\PostPlatform\ContentType; use App\Enums\SocialAccount\Platform; use App\Models\Post; +use App\Models\PostPlatform; use App\Models\SocialAccount; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PostPlatform> + * @extends Factory */ class PostPlatformFactory extends Factory { diff --git a/database/factories/SocialAccountFactory.php b/database/factories/SocialAccountFactory.php index b0d2e20a..d9a111c5 100644 --- a/database/factories/SocialAccountFactory.php +++ b/database/factories/SocialAccountFactory.php @@ -4,11 +4,12 @@ use App\Enums\SocialAccount\Platform; use App\Enums\SocialAccount\Status; +use App\Models\SocialAccount; use App\Models\Workspace; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\SocialAccount> + * @extends Factory */ class SocialAccountFactory extends Factory { diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index cba2d87b..6082d653 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -3,12 +3,13 @@ namespace Database\Factories; use App\Models\Language; +use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User> + * @extends Factory */ class UserFactory extends Factory { diff --git a/database/factories/WorkspaceFactory.php b/database/factories/WorkspaceFactory.php index 6de65ad6..b7b285de 100644 --- a/database/factories/WorkspaceFactory.php +++ b/database/factories/WorkspaceFactory.php @@ -3,10 +3,11 @@ namespace Database\Factories; use App\Models\User; +use App\Models\Workspace; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Workspace> + * @extends Factory */ class WorkspaceFactory extends Factory { diff --git a/database/factories/WorkspaceHashtagFactory.php b/database/factories/WorkspaceHashtagFactory.php index 93de23f8..adda2f0d 100644 --- a/database/factories/WorkspaceHashtagFactory.php +++ b/database/factories/WorkspaceHashtagFactory.php @@ -3,10 +3,11 @@ namespace Database\Factories; use App\Models\Workspace; +use App\Models\WorkspaceHashtag; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\WorkspaceHashtag> + * @extends Factory */ class WorkspaceHashtagFactory extends Factory { diff --git a/database/factories/WorkspaceInviteFactory.php b/database/factories/WorkspaceInviteFactory.php index 5a810e94..f5d86192 100644 --- a/database/factories/WorkspaceInviteFactory.php +++ b/database/factories/WorkspaceInviteFactory.php @@ -4,10 +4,11 @@ use App\Enums\UserWorkspace\Role; use App\Models\Workspace; +use App\Models\WorkspaceInvite; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\WorkspaceInvite> + * @extends Factory */ class WorkspaceInviteFactory extends Factory { diff --git a/database/factories/WorkspaceLabelFactory.php b/database/factories/WorkspaceLabelFactory.php index 064251fc..3fc0a785 100644 --- a/database/factories/WorkspaceLabelFactory.php +++ b/database/factories/WorkspaceLabelFactory.php @@ -3,10 +3,11 @@ namespace Database\Factories; use App\Models\Workspace; +use App\Models\WorkspaceLabel; use Illuminate\Database\Eloquent\Factories\Factory; /** - * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\WorkspaceLabel> + * @extends Factory */ class WorkspaceLabelFactory extends Factory { diff --git a/database/migrations/2026_03_29_215341_create_api_tokens_table.php b/database/migrations/2026_03_29_215341_create_api_tokens_table.php new file mode 100644 index 00000000..1390506a --- /dev/null +++ b/database/migrations/2026_03_29_215341_create_api_tokens_table.php @@ -0,0 +1,29 @@ +uuid('id')->primary(); + $table->foreignUuid('workspace_id')->constrained()->cascadeOnDelete(); + $table->string('name'); + $table->string('token_lookup', 16)->unique(); + $table->string('token_hash', 255); + $table->timestamp('last_used_at')->nullable(); + $table->timestamp('expires_at')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('api_tokens'); + } +}; diff --git a/lang/pt-br/passwords.php b/lang/pt-br/passwords.php index 49fa8f07..600b63b8 100644 --- a/lang/pt-br/passwords.php +++ b/lang/pt-br/passwords.php @@ -17,6 +17,6 @@ 'sent' => 'Enviamos o link de redefinição de senha por e-mail.', 'throttled' => 'Por favor, aguarde antes de tentar novamente.', 'token' => 'Este token de redefinição de senha é inválido.', - 'user' => "Não conseguimos encontrar um usuário com esse endereço de e-mail.", + 'user' => 'Não conseguimos encontrar um usuário com esse endereço de e-mail.', ]; diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 00000000..875a6564 --- /dev/null +++ b/routes/api.php @@ -0,0 +1,45 @@ + 'api.'.parse_url(config('app.url'), PHP_URL_HOST), + 'middleware' => ['api.auth'], + ], + function () { + // Posts + Route::get('/posts', [PostController::class, 'index'])->name('api.posts.index'); + Route::post('/posts', [PostController::class, 'store'])->name('api.posts.store'); + Route::get('/posts/{post}', [PostController::class, 'show'])->name('api.posts.show'); + Route::put('/posts/{post}', [PostController::class, 'update'])->name('api.posts.update'); + Route::delete('/posts/{post}', [PostController::class, 'destroy'])->name('api.posts.destroy'); + + // Workspace + Route::get('/workspace', [WorkspaceController::class, 'show'])->name('api.workspace.show'); + + // Hashtags + Route::get('/hashtags', [HashtagController::class, 'index'])->name('api.hashtags.index'); + Route::post('/hashtags', [HashtagController::class, 'store'])->name('api.hashtags.store'); + Route::put('/hashtags/{hashtag}', [HashtagController::class, 'update'])->name('api.hashtags.update'); + Route::delete('/hashtags/{hashtag}', [HashtagController::class, 'destroy'])->name('api.hashtags.destroy'); + + // Labels + Route::get('/labels', [LabelController::class, 'index'])->name('api.labels.index'); + Route::post('/labels', [LabelController::class, 'store'])->name('api.labels.store'); + Route::put('/labels/{label}', [LabelController::class, 'update'])->name('api.labels.update'); + Route::delete('/labels/{label}', [LabelController::class, 'destroy'])->name('api.labels.destroy'); + + // API Keys + Route::get('/api-keys', [ApiKeyController::class, 'index'])->name('api.api-keys.index'); + Route::post('/api-keys', [ApiKeyController::class, 'store'])->name('api.api-keys.store'); + Route::delete('/api-keys/{apiToken}', [ApiKeyController::class, 'destroy'])->name('api.api-keys.destroy'); + } +); diff --git a/routes/app.php b/routes/app.php new file mode 100644 index 00000000..e5aec5a4 --- /dev/null +++ b/routes/app.php @@ -0,0 +1,179 @@ + 'app.'.parse_url(config('app.url'), PHP_URL_HOST), + 'middleware' => ['web'], + ], + function () { + Route::get('/', function () { + return redirect()->route('app.calendar'); + })->name('app.home')->middleware(['auth', 'verified']); + + // Subscription selection (requires auth but not subscription) + Route::middleware(['auth', 'verified'])->group(function () { + Route::get('subscribe', [BillingController::class, 'subscribe'])->name('app.subscribe'); + Route::post('billing/checkout', [BillingController::class, 'checkout'])->name('app.billing.checkout'); + Route::get('billing/processing', [BillingController::class, 'processing'])->name('app.billing.processing'); + }); + + // Onboarding routes + Route::middleware(['auth', 'verified'])->prefix('onboarding')->group(function () { + Route::get('step1', [OnboardingController::class, 'step1'])->name('app.onboarding.step1'); + Route::post('step1', [OnboardingController::class, 'storeStep1'])->name('app.onboarding.step1.store'); + Route::get('step2', [OnboardingController::class, 'step2'])->name('app.onboarding.step2'); + Route::post('step2', [OnboardingController::class, 'storeStep2'])->name('app.onboarding.step2.store'); + Route::get('complete', [OnboardingController::class, 'complete'])->name('app.onboarding.complete'); + }); + + // Social Connect routes + Route::middleware(['auth', 'verified'])->group(function () { + Route::get('connect/linkedin', [LinkedInController::class, 'connect'])->name('app.social.linkedin.connect'); + Route::get('accounts/linkedin/callback', [LinkedInController::class, 'callback'])->name('app.social.linkedin.callback'); + + Route::get('connect/linkedin-page', [LinkedInPageController::class, 'connect'])->name('app.social.linkedin-page.connect'); + Route::get('accounts/linkedin-page/callback', [LinkedInPageController::class, 'callback'])->name('app.social.linkedin-page.callback'); + Route::get('accounts/linkedin-page/select', [LinkedInPageController::class, 'selectPage'])->name('app.social.linkedin-page.select-page'); + Route::post('accounts/linkedin-page/select', [LinkedInPageController::class, 'select'])->name('app.social.linkedin-page.select'); + + Route::get('connect/x', [XController::class, 'connect'])->name('app.social.x.connect'); + Route::get('accounts/x/callback', [XController::class, 'callback'])->name('app.social.x.callback'); + + Route::get('connect/tiktok', [TikTokController::class, 'connect'])->name('app.social.tiktok.connect'); + Route::get('accounts/tiktok/callback', [TikTokController::class, 'callback'])->name('app.social.tiktok.callback'); + + Route::get('connect/youtube', [YouTubeController::class, 'connect'])->name('app.social.youtube.connect'); + Route::get('accounts/youtube/callback', [YouTubeController::class, 'callback'])->name('app.social.youtube.callback'); + Route::get('accounts/youtube/select', [YouTubeController::class, 'selectChannel'])->name('app.social.youtube.select-channel'); + Route::post('accounts/youtube/select', [YouTubeController::class, 'select'])->name('app.social.youtube.select'); + + Route::get('connect/facebook', [FacebookController::class, 'connect'])->name('app.social.facebook.connect'); + Route::get('accounts/facebook/callback', [FacebookController::class, 'callback'])->name('app.social.facebook.callback'); + Route::get('accounts/facebook/select', [FacebookController::class, 'selectPage'])->name('app.social.facebook.select-page'); + Route::post('accounts/facebook/select', [FacebookController::class, 'select'])->name('app.social.facebook.select'); + + Route::get('connect/instagram', [InstagramController::class, 'connect'])->name('app.social.instagram.connect'); + Route::get('accounts/instagram/callback', [InstagramController::class, 'callback'])->name('app.social.instagram.callback'); + Route::get('accounts/instagram/select', [InstagramController::class, 'selectAccount'])->name('app.social.instagram.select-account'); + Route::post('accounts/instagram/select', [InstagramController::class, 'select'])->name('app.social.instagram.select'); + + Route::get('connect/threads', [ThreadsController::class, 'connect'])->name('app.social.threads.connect'); + Route::get('accounts/threads/callback', [ThreadsController::class, 'callback'])->name('app.social.threads.callback'); + + Route::get('connect/pinterest', [PinterestController::class, 'connect'])->name('app.social.pinterest.connect'); + Route::get('accounts/pinterest/callback', [PinterestController::class, 'callback'])->name('app.social.pinterest.callback'); + + Route::get('connect/bluesky', [BlueskyController::class, 'connect'])->name('app.social.bluesky.connect'); + Route::post('connect/bluesky', [BlueskyController::class, 'store'])->name('app.social.bluesky.store'); + + Route::get('connect/mastodon', [MastodonController::class, 'connect'])->name('app.social.mastodon.connect'); + Route::post('connect/mastodon', [MastodonController::class, 'authorizeInstance'])->name('app.social.mastodon.authorize'); + Route::get('accounts/mastodon/callback', [MastodonController::class, 'callback'])->name('app.social.mastodon.callback'); + }); + + // Routes that require active subscription and completed onboarding + Route::middleware(['auth', 'verified', 'subscribed', EnsureUserSetupIsComplete::class])->group(function () { + // Workspaces + Route::get('workspaces', [WorkspaceController::class, 'index'])->name('app.workspaces.index'); + Route::get('workspaces/create', [WorkspaceController::class, 'create'])->name('app.workspaces.create'); + Route::post('workspaces', [WorkspaceController::class, 'store'])->name('app.workspaces.store'); + Route::post('workspaces/{workspace}/switch', [WorkspaceController::class, 'switch'])->name('app.workspaces.switch'); + Route::delete('workspaces/{workspace}', [WorkspaceController::class, 'destroy'])->name('app.workspaces.destroy'); + + // Workspace settings + Route::get('settings/workspace', [WorkspaceController::class, 'settings'])->name('app.workspace.settings'); + Route::put('settings/workspace', [WorkspaceController::class, 'updateSettings'])->name('app.workspace.settings.update'); + + // Social Accounts + Route::get('accounts', [SocialController::class, 'index'])->name('app.accounts'); + Route::delete('accounts/{account}', [SocialController::class, 'disconnect'])->name('app.accounts.disconnect'); + + // Calendar + Route::get('calendar', [PostController::class, 'calendar'])->name('app.calendar'); + + // Posts + Route::get('posts/{status?}', [PostController::class, 'index'])->name('app.posts.index')->where('status', 'draft|scheduled|published'); + Route::post('posts', [PostController::class, 'store'])->name('app.posts.store'); + Route::get('posts/{post}/edit', [PostController::class, 'edit'])->name('app.posts.edit'); + Route::put('posts/{post}', [PostController::class, 'update'])->name('app.posts.update'); + Route::delete('posts/{post}', [PostController::class, 'destroy'])->name('app.posts.destroy'); + + // Media + Route::post('medias', [MediaController::class, 'store'])->name('app.medias.store'); + Route::post('medias/chunked', [MediaController::class, 'storeChunked'])->name('app.medias.store-chunked'); + Route::post('medias/reorder', [MediaController::class, 'reorder'])->name('app.medias.reorder'); + Route::post('medias/{media}/duplicate', [MediaController::class, 'duplicate'])->name('app.medias.duplicate'); + Route::delete('medias/{modelId}/{media}', [MediaController::class, 'destroy'])->name('app.medias.destroy'); + + // Members + Route::get('settings/members', [WorkspaceInviteController::class, 'index'])->name('app.members'); + Route::post('settings/members/invites', [WorkspaceInviteController::class, 'store'])->name('app.invites.store'); + Route::delete('settings/members/invites/{invite}', [WorkspaceInviteController::class, 'destroy'])->name('app.invites.destroy'); + Route::delete('settings/members/{user}', [WorkspaceInviteController::class, 'removeMember'])->name('app.members.remove'); + + // Hashtags + Route::get('hashtags', [WorkspaceHashtagController::class, 'index'])->name('app.hashtags.index'); + Route::post('hashtags', [WorkspaceHashtagController::class, 'store'])->name('app.hashtags.store'); + Route::put('hashtags/{hashtag}', [WorkspaceHashtagController::class, 'update'])->name('app.hashtags.update'); + Route::delete('hashtags/{hashtag}', [WorkspaceHashtagController::class, 'destroy'])->name('app.hashtags.destroy'); + + // Labels + Route::get('labels', [WorkspaceLabelController::class, 'index'])->name('app.labels.index'); + Route::post('labels', [WorkspaceLabelController::class, 'store'])->name('app.labels.store'); + Route::put('labels/{label}', [WorkspaceLabelController::class, 'update'])->name('app.labels.update'); + Route::delete('labels/{label}', [WorkspaceLabelController::class, 'destroy'])->name('app.labels.destroy'); + + // API Keys + Route::get('api-keys', [ApiKeyController::class, 'index'])->name('app.api-keys.index'); + Route::post('api-keys', [ApiKeyController::class, 'store'])->name('app.api-keys.store'); + Route::delete('api-keys/{apiToken}', [ApiKeyController::class, 'destroy'])->name('app.api-keys.destroy'); + + // Billing + Route::get('settings/billing', [BillingController::class, 'index'])->name('app.billing.index'); + Route::get('settings/billing/portal', [BillingController::class, 'portal'])->name('app.billing.portal'); + }); + + // Settings (auth required) + Route::middleware(['auth'])->group(function () { + Route::get('settings/profile', [ProfileController::class, 'edit'])->name('app.profile.edit'); + Route::patch('settings/profile', [ProfileController::class, 'update'])->name('app.profile.update'); + Route::patch('settings/language', [ProfileController::class, 'updateLanguage'])->name('app.profile.language'); + }); + + Route::middleware(['auth', 'verified'])->group(function () { + Route::delete('settings/profile', [ProfileController::class, 'destroy'])->name('app.profile.destroy'); + Route::get('settings/password', [PasswordController::class, 'edit'])->name('app.user-password.edit'); + Route::put('settings/password', [PasswordController::class, 'update']) + ->middleware('throttle:6,1') + ->name('app.user-password.update'); + }); + } +); diff --git a/routes/auth.php b/routes/auth.php index be29bbc3..2ac434db 100644 --- a/routes/auth.php +++ b/routes/auth.php @@ -12,35 +12,44 @@ use App\Http\Controllers\Auth\VerifyEmailController; use Illuminate\Support\Facades\Route; -Route::middleware('guest')->group(function () { - Route::get('/register', [RegisteredUserController::class, 'create'])->name('register'); - Route::post('/register', [RegisteredUserController::class, 'store'])->name('register.store'); +Route::group( + [ + 'domain' => 'app.'.parse_url(config('app.url'), PHP_URL_HOST), + 'middleware' => ['web'], + ], + function () { - Route::get('/login', [AuthenticatedSessionController::class, 'create'])->name('login'); - Route::post('/login', [AuthenticatedSessionController::class, 'store'])->name('login.store'); + Route::middleware('guest')->group(function () { + Route::get('/register', [RegisteredUserController::class, 'create'])->name('register'); + Route::post('/register', [RegisteredUserController::class, 'store'])->name('register.store'); - Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])->name('password.request'); - Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])->name('password.email'); + Route::get('/login', [AuthenticatedSessionController::class, 'create'])->name('login'); + Route::post('/login', [AuthenticatedSessionController::class, 'store'])->name('login.store'); - Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])->name('password.reset'); - Route::post('/reset-password', [NewPasswordController::class, 'store'])->name('password.store'); -}); + Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])->name('password.request'); + Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])->name('password.email'); -// Invite routes - accessible by both guests and authenticated users -Route::get('/invites/{invite}', [AcceptInviteController::class, 'show'])->name('invites.show'); -Route::post('/invites/{invite}/accept', [AcceptInviteController::class, 'accept'])->name('invites.accept')->middleware('auth'); -Route::post('/invites/{invite}/decline', [AcceptInviteController::class, 'decline'])->name('invites.decline')->middleware('auth'); + Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])->name('password.reset'); + Route::post('/reset-password', [NewPasswordController::class, 'store'])->name('password.store'); + }); -Route::middleware('auth')->group(function () { - Route::get('/verify-email', EmailVerificationPromptController::class)->name('verification.notice'); + // Invite routes - accessible by both guests and authenticated users + Route::get('/invites/{invite}', [AcceptInviteController::class, 'show'])->name('app.invites.show'); + Route::post('/invites/{invite}/accept', [AcceptInviteController::class, 'accept'])->name('app.invites.accept')->middleware('auth'); + Route::post('/invites/{invite}/decline', [AcceptInviteController::class, 'decline'])->name('app.invites.decline')->middleware('auth'); - Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class) - ->middleware(['signed', 'throttle:6,1']) - ->name('verification.verify'); + Route::middleware('auth')->group(function () { + Route::get('/verify-email', EmailVerificationPromptController::class)->name('verification.notice'); - Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store']) - ->middleware('throttle:6,1') - ->name('verification.send'); + Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class) + ->middleware(['signed', 'throttle:6,1']) + ->name('verification.verify'); - Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout'); -}); + Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store']) + ->middleware('throttle:6,1') + ->name('verification.send'); + + Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout'); + }); + + }); // end domain group diff --git a/routes/web.php b/routes/web.php index 4986a5d3..0086ce7e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,148 +1,4 @@ route('calendar'); -})->name('home')->middleware(['auth', 'verified']); - -// Subscription selection (requires auth but not subscription) -Route::middleware(['auth', 'verified'])->group(function () { - Route::get('subscribe', [BillingController::class, 'subscribe'])->name('subscribe'); - Route::post('billing/checkout', [BillingController::class, 'checkout'])->name('billing.checkout'); - Route::get('billing/processing', [BillingController::class, 'processing'])->name('billing.processing'); -}); - -// Onboarding routes (requires auth but not subscription or setup complete) -Route::middleware(['auth', 'verified'])->prefix('onboarding')->group(function () { - Route::get('step1', [OnboardingController::class, 'step1'])->name('onboarding.step1'); - Route::post('step1', [OnboardingController::class, 'storeStep1'])->name('onboarding.step1.store'); - Route::get('step2', [OnboardingController::class, 'step2'])->name('onboarding.step2'); - Route::post('step2', [OnboardingController::class, 'storeStep2'])->name('onboarding.step2.store'); - Route::get('complete', [OnboardingController::class, 'complete'])->name('onboarding.complete'); -}); - -// Social Connect routes (requires auth but not subscription - needed for onboarding) -Route::middleware(['auth', 'verified'])->group(function () { - Route::get('connect/linkedin', [LinkedInController::class, 'connect'])->name('social.linkedin.connect'); - Route::get('accounts/linkedin/callback', [LinkedInController::class, 'callback'])->name('social.linkedin.callback'); - - Route::get('connect/linkedin-page', [LinkedInPageController::class, 'connect'])->name('social.linkedin-page.connect'); - Route::get('accounts/linkedin-page/callback', [LinkedInPageController::class, 'callback'])->name('social.linkedin-page.callback'); - Route::get('accounts/linkedin-page/select', [LinkedInPageController::class, 'selectPage'])->name('social.linkedin-page.select-page'); - Route::post('accounts/linkedin-page/select', [LinkedInPageController::class, 'select'])->name('social.linkedin-page.select'); - - Route::get('connect/x', [XController::class, 'connect'])->name('social.x.connect'); - Route::get('accounts/x/callback', [XController::class, 'callback'])->name('social.x.callback'); - - Route::get('connect/tiktok', [TikTokController::class, 'connect'])->name('social.tiktok.connect'); - Route::get('accounts/tiktok/callback', [TikTokController::class, 'callback'])->name('social.tiktok.callback'); - - Route::get('connect/youtube', [YouTubeController::class, 'connect'])->name('social.youtube.connect'); - Route::get('accounts/youtube/callback', [YouTubeController::class, 'callback'])->name('social.youtube.callback'); - Route::get('accounts/youtube/select', [YouTubeController::class, 'selectChannel'])->name('social.youtube.select-channel'); - Route::post('accounts/youtube/select', [YouTubeController::class, 'select'])->name('social.youtube.select'); - - Route::get('connect/facebook', [FacebookController::class, 'connect'])->name('social.facebook.connect'); - Route::get('accounts/facebook/callback', [FacebookController::class, 'callback'])->name('social.facebook.callback'); - Route::get('accounts/facebook/select', [FacebookController::class, 'selectPage'])->name('social.facebook.select-page'); - Route::post('accounts/facebook/select', [FacebookController::class, 'select'])->name('social.facebook.select'); - - Route::get('connect/instagram', [InstagramController::class, 'connect'])->name('social.instagram.connect'); - Route::get('accounts/instagram/callback', [InstagramController::class, 'callback'])->name('social.instagram.callback'); - Route::get('accounts/instagram/select', [InstagramController::class, 'selectAccount'])->name('social.instagram.select-account'); - Route::post('accounts/instagram/select', [InstagramController::class, 'select'])->name('social.instagram.select'); - - Route::get('connect/threads', [ThreadsController::class, 'connect'])->name('social.threads.connect'); - Route::get('accounts/threads/callback', [ThreadsController::class, 'callback'])->name('social.threads.callback'); - - Route::get('connect/pinterest', [PinterestController::class, 'connect'])->name('social.pinterest.connect'); - Route::get('accounts/pinterest/callback', [PinterestController::class, 'callback'])->name('social.pinterest.callback'); - - Route::get('connect/bluesky', [BlueskyController::class, 'connect'])->name('social.bluesky.connect'); - Route::post('connect/bluesky', [BlueskyController::class, 'store'])->name('social.bluesky.store'); - - Route::get('connect/mastodon', [MastodonController::class, 'connect'])->name('social.mastodon.connect'); - Route::post('connect/mastodon', [MastodonController::class, 'authorizeInstance'])->name('social.mastodon.authorize'); - Route::get('accounts/mastodon/callback', [MastodonController::class, 'callback'])->name('social.mastodon.callback'); -}); - -// Routes that require active subscription and completed onboarding -Route::middleware(['auth', 'verified', 'subscribed', EnsureUserSetupIsComplete::class])->group(function () { - // Workspaces management - Route::get('workspaces', [WorkspaceController::class, 'index'])->name('workspaces.index'); - Route::get('workspaces/create', [WorkspaceController::class, 'create'])->name('workspaces.create'); - Route::post('workspaces', [WorkspaceController::class, 'store'])->name('workspaces.store'); - Route::post('workspaces/{workspace}/switch', [WorkspaceController::class, 'switch'])->name('workspaces.switch'); - Route::delete('workspaces/{workspace}', [WorkspaceController::class, 'destroy'])->name('workspaces.destroy'); - - // Current workspace settings - Route::get('settings/workspace', [WorkspaceController::class, 'settings'])->name('workspace.settings'); - Route::put('settings/workspace', [WorkspaceController::class, 'updateSettings'])->name('workspace.settings.update'); - - // Social Accounts - Route::get('accounts', [SocialController::class, 'index'])->name('accounts'); - Route::delete('accounts/{account}', [SocialController::class, 'disconnect'])->name('accounts.disconnect'); - - // Calendar - Route::get('calendar', [PostController::class, 'calendar'])->name('calendar'); - - // Posts - Route::get('posts/{status?}', [PostController::class, 'index'])->name('posts.index')->where('status', 'draft|scheduled|published'); - Route::post('posts', [PostController::class, 'store'])->name('posts.store'); - Route::get('posts/{post}/edit', [PostController::class, 'edit'])->name('posts.edit'); - Route::put('posts/{post}', [PostController::class, 'update'])->name('posts.update'); - Route::delete('posts/{post}', [PostController::class, 'destroy'])->name('posts.destroy'); - - // Media - Route::post('medias', [MediaController::class, 'store'])->name('medias.store'); - Route::post('medias/chunked', [MediaController::class, 'storeChunked'])->name('medias.store-chunked'); - Route::post('medias/reorder', [MediaController::class, 'reorder'])->name('medias.reorder'); - Route::post('medias/{media}/duplicate', [MediaController::class, 'duplicate'])->name('medias.duplicate'); - Route::delete('medias/{modelId}/{media}', [MediaController::class, 'destroy'])->name('medias.destroy'); - - // Members (Settings) - Route::get('settings/members', [WorkspaceInviteController::class, 'index'])->name('members'); - Route::post('settings/members/invites', [WorkspaceInviteController::class, 'store'])->name('invites.store'); - Route::delete('settings/members/invites/{invite}', [WorkspaceInviteController::class, 'destroy'])->name('invites.destroy'); - Route::delete('settings/members/{user}', [WorkspaceInviteController::class, 'removeMember'])->name('members.remove'); - - // Hashtags - Route::get('hashtags', [WorkspaceHashtagController::class, 'index'])->name('hashtags.index'); - Route::post('hashtags', [WorkspaceHashtagController::class, 'store'])->name('hashtags.store'); - Route::put('hashtags/{hashtag}', [WorkspaceHashtagController::class, 'update'])->name('hashtags.update'); - Route::delete('hashtags/{hashtag}', [WorkspaceHashtagController::class, 'destroy'])->name('hashtags.destroy'); - - // Labels - Route::get('labels', [WorkspaceLabelController::class, 'index'])->name('labels.index'); - Route::post('labels', [WorkspaceLabelController::class, 'store'])->name('labels.store'); - Route::put('labels/{label}', [WorkspaceLabelController::class, 'update'])->name('labels.update'); - Route::delete('labels/{label}', [WorkspaceLabelController::class, 'destroy'])->name('labels.destroy'); - - // Billing (under settings prefix) - Route::get('settings/billing', [BillingController::class, 'index'])->name('billing.index'); - Route::get('settings/billing/portal', [BillingController::class, 'portal'])->name('billing.portal'); -}); - -require __DIR__.'/settings.php'; +require __DIR__.'/auth.php'; +require __DIR__.'/app.php'; diff --git a/tests/Feature/AcceptInviteControllerTest.php b/tests/Feature/AcceptInviteControllerTest.php index ce9d5dfc..66e1c491 100644 --- a/tests/Feature/AcceptInviteControllerTest.php +++ b/tests/Feature/AcceptInviteControllerTest.php @@ -20,7 +20,7 @@ 'role' => WorkspaceRole::Member, ]); - $response = $this->get(route('invites.show', $invite)); + $response = $this->get(route('app.invites.show', $invite)); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -45,7 +45,7 @@ 'role' => WorkspaceRole::Member, ]); - $response = $this->actingAs($user)->get(route('invites.show', $invite)); + $response = $this->actingAs($user)->get(route('app.invites.show', $invite)); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -55,7 +55,7 @@ }); test('show invite returns 404 for non-existent invite', function () { - $response = $this->get(route('invites.show', 'non-existent-uuid')); + $response = $this->get(route('app.invites.show', 'non-existent-uuid')); $response->assertNotFound(); }); @@ -65,7 +65,7 @@ 'workspace_id' => $this->workspace->id, ]); - $response = $this->post(route('invites.accept', $invite)); + $response = $this->post(route('app.invites.accept', $invite)); $response->assertRedirect(route('login')); }); @@ -82,9 +82,9 @@ 'role' => WorkspaceRole::Admin, ]); - $response = $this->actingAs($user)->post(route('invites.accept', $invite)); + $response = $this->actingAs($user)->post(route('app.invites.accept', $invite)); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); // User should be member of workspace expect($this->workspace->hasMember($user))->toBeTrue(); @@ -109,9 +109,9 @@ 'role' => WorkspaceRole::Member, ]); - $response = $this->actingAs($user)->post(route('invites.accept', $invite)); + $response = $this->actingAs($user)->post(route('app.invites.accept', $invite)); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $response->assertSessionHas('flash.bannerStyle', 'danger'); // Invite should NOT be deleted @@ -132,9 +132,9 @@ 'role' => WorkspaceRole::Admin, ]); - $response = $this->actingAs($user)->post(route('invites.accept', $invite)); + $response = $this->actingAs($user)->post(route('app.invites.accept', $invite)); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $response->assertSessionHas('flash.bannerStyle', 'info'); // Invite should be deleted @@ -146,7 +146,7 @@ 'workspace_id' => $this->workspace->id, ]); - $response = $this->post(route('invites.decline', $invite)); + $response = $this->post(route('app.invites.decline', $invite)); $response->assertRedirect(route('login')); }); @@ -163,9 +163,9 @@ 'role' => WorkspaceRole::Member, ]); - $response = $this->actingAs($user)->post(route('invites.decline', $invite)); + $response = $this->actingAs($user)->post(route('app.invites.decline', $invite)); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $response->assertSessionHas('flash.bannerStyle', 'info'); // Invite should be deleted @@ -187,9 +187,9 @@ 'role' => WorkspaceRole::Member, ]); - $response = $this->actingAs($user)->post(route('invites.decline', $invite)); + $response = $this->actingAs($user)->post(route('app.invites.decline', $invite)); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $response->assertSessionHas('flash.bannerStyle', 'danger'); // Invite should NOT be deleted diff --git a/tests/Feature/Auth/AuthenticationTest.php b/tests/Feature/Auth/AuthenticationTest.php index 17a0bfb5..770d6062 100644 --- a/tests/Feature/Auth/AuthenticationTest.php +++ b/tests/Feature/Auth/AuthenticationTest.php @@ -19,7 +19,7 @@ ]); $this->assertAuthenticated(); - $response->assertRedirect(route('calendar', absolute: false)); + $response->assertRedirect(route('app.calendar', absolute: false)); }); test('users can not authenticate with invalid password', function () { diff --git a/tests/Feature/Auth/EmailVerificationTest.php b/tests/Feature/Auth/EmailVerificationTest.php index eff01195..1abc32c9 100644 --- a/tests/Feature/Auth/EmailVerificationTest.php +++ b/tests/Feature/Auth/EmailVerificationTest.php @@ -28,7 +28,7 @@ Event::assertDispatched(Verified::class); expect($user->fresh()->hasVerifiedEmail())->toBeTrue(); - $response->assertRedirect(route('calendar', absolute: false).'?verified=1'); + $response->assertRedirect(route('app.calendar', absolute: false).'?verified=1'); }); test('email is not verified with invalid hash', function () { @@ -73,7 +73,7 @@ $response = $this->actingAs($user)->get(route('verification.notice')); Event::assertNotDispatched(Verified::class); - $response->assertRedirect(route('calendar', absolute: false)); + $response->assertRedirect(route('app.calendar', absolute: false)); }); test('already verified user visiting verification link is redirected without firing event again', function () { @@ -88,7 +88,7 @@ ); $this->actingAs($user)->get($verificationUrl) - ->assertRedirect(route('calendar', absolute: false).'?verified=1'); + ->assertRedirect(route('app.calendar', absolute: false).'?verified=1'); Event::assertNotDispatched(Verified::class); expect($user->fresh()->hasVerifiedEmail())->toBeTrue(); diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.php index 3a5924e1..1ea65128 100644 --- a/tests/Feature/Auth/RegistrationTest.php +++ b/tests/Feature/Auth/RegistrationTest.php @@ -17,7 +17,7 @@ $response->assertSessionHasNoErrors(); $this->assertAuthenticated(); - $response->assertRedirect(route('onboarding.step1', absolute: false)); + $response->assertRedirect(route('app.onboarding.step1', absolute: false)); }); test('new users get a default workspace on registration', function () { diff --git a/tests/Feature/Auth/VerificationNotificationTest.php b/tests/Feature/Auth/VerificationNotificationTest.php index 81bdd287..adec9f6b 100644 --- a/tests/Feature/Auth/VerificationNotificationTest.php +++ b/tests/Feature/Auth/VerificationNotificationTest.php @@ -11,7 +11,7 @@ $this->actingAs($user) ->post(route('verification.send')) - ->assertRedirect(route('home')); + ->assertRedirect(route('app.home')); Notification::assertSentTo($user, VerifyEmail::class); }); @@ -23,7 +23,7 @@ $this->actingAs($user) ->post(route('verification.send')) - ->assertRedirect(route('calendar', absolute: false)); + ->assertRedirect(route('app.calendar', absolute: false)); Notification::assertNothingSent(); }); diff --git a/tests/Feature/BillingControllerTest.php b/tests/Feature/BillingControllerTest.php index 13bdc8f3..2ed7ed5c 100644 --- a/tests/Feature/BillingControllerTest.php +++ b/tests/Feature/BillingControllerTest.php @@ -12,13 +12,13 @@ // Subscribe tests test('subscribe requires authentication', function () { - $response = $this->get(route('subscribe')); + $response = $this->get(route('app.subscribe')); $response->assertRedirect(route('login')); }); test('subscribe shows subscription page', function () { - $response = $this->actingAs($this->user)->get(route('subscribe')); + $response = $this->actingAs($this->user)->get(route('app.subscribe')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -29,13 +29,13 @@ // Index tests test('billing index requires authentication', function () { - $response = $this->get(route('billing.index')); + $response = $this->get(route('app.billing.index')); $response->assertRedirect(route('login')); }); test('billing index shows billing dashboard', function () { - $response = $this->actingAs($this->user)->get(route('billing.index')); + $response = $this->actingAs($this->user)->get(route('app.billing.index')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -47,13 +47,13 @@ // Processing tests test('billing processing requires authentication', function () { - $response = $this->get(route('billing.processing')); + $response = $this->get(route('app.billing.processing')); $response->assertRedirect(route('login')); }); test('billing processing shows processing page', function () { - $response = $this->actingAs($this->user)->get(route('billing.processing')); + $response = $this->actingAs($this->user)->get(route('app.billing.processing')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -64,7 +64,7 @@ }); test('billing processing accepts status parameter', function () { - $response = $this->actingAs($this->user)->get(route('billing.processing', ['status' => 'success'])); + $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'success'])); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -73,7 +73,7 @@ }); test('billing processing validates status parameter', function () { - $response = $this->actingAs($this->user)->get(route('billing.processing', ['status' => 'invalid'])); + $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'invalid'])); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -83,14 +83,14 @@ // Checkout tests test('checkout requires authentication', function () { - $response = $this->post(route('billing.checkout')); + $response = $this->post(route('app.billing.checkout')); $response->assertRedirect(route('login')); }); // Portal tests test('portal requires authentication', function () { - $response = $this->get(route('billing.portal')); + $response = $this->get(route('app.billing.portal')); $response->assertRedirect(route('login')); }); diff --git a/tests/Feature/Controllers/BillingControllerTest.php b/tests/Feature/Controllers/BillingControllerTest.php index 4bbeaa4b..758ff111 100644 --- a/tests/Feature/Controllers/BillingControllerTest.php +++ b/tests/Feature/Controllers/BillingControllerTest.php @@ -21,7 +21,7 @@ 'quantity' => 2, ]); - $response = $this->actingAs($this->user)->get(route('billing.index')); + $response = $this->actingAs($this->user)->get(route('app.billing.index')); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -33,7 +33,7 @@ }); test('billing index shows info for user without subscription', function () { - $response = $this->actingAs($this->user)->get(route('billing.index')); + $response = $this->actingAs($this->user)->get(route('app.billing.index')); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -52,7 +52,7 @@ 'trial_ends_at' => now()->addDays(14), ]); - $response = $this->actingAs($this->user)->get(route('billing.index')); + $response = $this->actingAs($this->user)->get(route('app.billing.index')); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -63,7 +63,7 @@ }); test('processing page shows for user during checkout', function () { - $response = $this->actingAs($this->user)->get(route('billing.processing', ['status' => 'success'])); + $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'success'])); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -74,7 +74,7 @@ }); test('processing page shows cancelled status', function () { - $response = $this->actingAs($this->user)->get(route('billing.processing', ['status' => 'cancelled'])); + $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'cancelled'])); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -83,7 +83,7 @@ }); test('processing page defaults to processing status for invalid status', function () { - $response = $this->actingAs($this->user)->get(route('billing.processing', ['status' => 'invalid'])); + $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'invalid'])); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page diff --git a/tests/Feature/Controllers/ChunkedUploadTest.php b/tests/Feature/Controllers/ChunkedUploadTest.php index 2de2deb1..ca7804cd 100644 --- a/tests/Feature/Controllers/ChunkedUploadTest.php +++ b/tests/Feature/Controllers/ChunkedUploadTest.php @@ -27,7 +27,7 @@ $response = $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -56,7 +56,7 @@ $response = $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -88,7 +88,7 @@ // First chunk $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -107,7 +107,7 @@ // Second chunk (last) $response = $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -131,7 +131,7 @@ test('chunked upload fails without content range header', function () { $response = $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -152,7 +152,7 @@ test('chunked upload fails with invalid model type', function () { $response = $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -174,7 +174,7 @@ test('chunked upload fails without model header', function () { $response = $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -194,7 +194,7 @@ test('chunked upload fails without file name header', function () { $response = $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], @@ -219,7 +219,7 @@ $this->actingAs($this->user)->call( 'POST', - route('medias.store-chunked'), + route('app.medias.store-chunked'), [], [], [], diff --git a/tests/Feature/Controllers/MediaControllerTest.php b/tests/Feature/Controllers/MediaControllerTest.php index 2cea97af..624b56ca 100644 --- a/tests/Feature/Controllers/MediaControllerTest.php +++ b/tests/Feature/Controllers/MediaControllerTest.php @@ -3,6 +3,7 @@ use App\Enums\User\Setup; use App\Models\Media; use App\Models\PostPlatform; +use App\Models\SocialAccount; use App\Models\User; use App\Models\Workspace; use Illuminate\Http\UploadedFile; @@ -27,7 +28,7 @@ test('user can upload media to workspace', function () { $file = UploadedFile::fake()->image('logo.jpg', 100, 100); - $response = $this->actingAs($this->user)->postJson(route('medias.store'), [ + $response = $this->actingAs($this->user)->postJson(route('app.medias.store'), [ 'media' => $file, 'model' => 'workspace', 'model_id' => $this->workspace->id, @@ -43,7 +44,7 @@ $file = UploadedFile::fake()->image('logo.jpg', 100, 100); $media = $this->workspace->addMedia($file, 'logo'); - $response = $this->actingAs($this->user)->deleteJson(route('medias.destroy', [ + $response = $this->actingAs($this->user)->deleteJson(route('app.medias.destroy', [ 'modelId' => $this->workspace->id, 'media' => $media->id, ])); @@ -58,7 +59,7 @@ $otherWorkspace = Workspace::factory()->create(); - $response = $this->actingAs($this->user)->deleteJson(route('medias.destroy', [ + $response = $this->actingAs($this->user)->deleteJson(route('app.medias.destroy', [ 'modelId' => $otherWorkspace->id, 'media' => $media->id, ])); @@ -71,12 +72,12 @@ $media = $this->workspace->addMedia($file, 'default'); $postPlatform = PostPlatform::factory()->create([ - 'social_account_id' => \App\Models\SocialAccount::factory()->linkedin()->create([ + 'social_account_id' => SocialAccount::factory()->linkedin()->create([ 'workspace_id' => $this->workspace->id, ])->id, ]); - $response = $this->actingAs($this->user)->postJson(route('medias.duplicate', ['media' => $media->id]), [ + $response = $this->actingAs($this->user)->postJson(route('app.medias.duplicate', ['media' => $media->id]), [ 'targets' => [ [ 'model' => 'postPlatform', @@ -93,7 +94,7 @@ test('media store fails with invalid model type', function () { $file = UploadedFile::fake()->image('logo.jpg', 100, 100); - $response = $this->actingAs($this->user)->postJson(route('medias.store'), [ + $response = $this->actingAs($this->user)->postJson(route('app.medias.store'), [ 'media' => $file, 'model' => 'invalid', 'model_id' => $this->workspace->id, diff --git a/tests/Feature/Controllers/OnboardingControllerTest.php b/tests/Feature/Controllers/OnboardingControllerTest.php index b7df7066..ca7db7ed 100644 --- a/tests/Feature/Controllers/OnboardingControllerTest.php +++ b/tests/Feature/Controllers/OnboardingControllerTest.php @@ -12,7 +12,7 @@ }); test('step1 shows persona selection', function () { - $response = $this->actingAs($this->user)->get(route('onboarding.step1')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.step1')); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -22,17 +22,17 @@ }); test('step1 can be stored with valid persona', function () { - $response = $this->actingAs($this->user)->post(route('onboarding.step1.store'), [ + $response = $this->actingAs($this->user)->post(route('app.onboarding.step1.store'), [ 'persona' => Persona::Creator->value, ]); - $response->assertRedirect(route('onboarding.step2')); + $response->assertRedirect(route('app.onboarding.step2')); expect($this->user->fresh()->persona)->toBe(Persona::Creator); expect($this->user->fresh()->setup)->toBe(Setup::Connections); }); test('step1 fails with invalid persona', function () { - $response = $this->actingAs($this->user)->post(route('onboarding.step1.store'), [ + $response = $this->actingAs($this->user)->post(route('app.onboarding.step1.store'), [ 'persona' => 'invalid', ]); @@ -44,7 +44,7 @@ $workspace = Workspace::factory()->create(['user_id' => $this->user->id]); $this->user->update(['current_workspace_id' => $workspace->id]); - $response = $this->actingAs($this->user)->get(route('onboarding.step2')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.step2')); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -57,7 +57,7 @@ test('step2 shows without workspace', function () { $this->user->update(['setup' => Setup::Connections]); - $response = $this->actingAs($this->user)->get(route('onboarding.step2')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.step2')); $response->assertSuccessful(); $response->assertInertia(fn ($page) => $page @@ -69,17 +69,17 @@ config(['trypost.self_hosted' => true]); $this->user->update(['setup' => Setup::Connections]); - $response = $this->actingAs($this->user)->post(route('onboarding.step2.store')); + $response = $this->actingAs($this->user)->post(route('app.onboarding.step2.store')); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); expect($this->user->fresh()->setup)->toBe(Setup::Completed); }); test('complete sets setup to completed', function () { $this->user->update(['setup' => Setup::Subscription]); - $response = $this->actingAs($this->user)->get(route('onboarding.complete')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.complete')); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); expect($this->user->fresh()->setup)->toBe(Setup::Completed); }); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index eb11b08f..0c41590f 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -3,7 +3,7 @@ use App\Models\User; test('home redirects to login for guests', function () { - $response = $this->get(route('home')); + $response = $this->get(route('app.home')); $response->assertRedirect(route('login')); }); @@ -11,7 +11,7 @@ test('home redirects to calendar for authenticated users', function () { $user = User::factory()->create(); - $response = $this->actingAs($user)->get(route('home')); + $response = $this->actingAs($user)->get(route('app.home')); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); }); diff --git a/tests/Feature/Jobs/PublishToSocialPlatformTest.php b/tests/Feature/Jobs/PublishToSocialPlatformTest.php index 0a11383c..574fb62a 100644 --- a/tests/Feature/Jobs/PublishToSocialPlatformTest.php +++ b/tests/Feature/Jobs/PublishToSocialPlatformTest.php @@ -70,7 +70,7 @@ Event::fake(); $publisher = Mockery::mock(LinkedInPublisher::class); - $publisher->shouldReceive('publish')->andThrow(new \Exception('API Error')); + $publisher->shouldReceive('publish')->andThrow(new Exception('API Error')); $this->app->instance(LinkedInPublisher::class, $publisher); @@ -147,7 +147,7 @@ Event::fake(); $publisher = Mockery::mock(LinkedInPublisher::class); - $publisher->shouldReceive('publish')->andThrow(new \Exception('API Error')); + $publisher->shouldReceive('publish')->andThrow(new Exception('API Error')); $this->app->instance(LinkedInPublisher::class, $publisher); diff --git a/tests/Feature/MediaControllerTest.php b/tests/Feature/MediaControllerTest.php index 2ef3fd92..c8a0e19b 100644 --- a/tests/Feature/MediaControllerTest.php +++ b/tests/Feature/MediaControllerTest.php @@ -29,7 +29,7 @@ // Store tests test('store media requires authentication', function () { - $response = $this->post(route('medias.store'), [ + $response = $this->post(route('app.medias.store'), [ 'model' => 'postPlatform', 'model_id' => $this->postPlatform->id, 'media' => UploadedFile::fake()->image('test.jpg'), @@ -39,7 +39,7 @@ }); test('store media uploads file', function () { - $response = $this->actingAs($this->user)->post(route('medias.store'), [ + $response = $this->actingAs($this->user)->post(route('app.medias.store'), [ 'model' => 'postPlatform', 'model_id' => $this->postPlatform->id, 'media' => UploadedFile::fake()->image('test.jpg'), @@ -50,7 +50,7 @@ }); test('store media validates required fields', function () { - $response = $this->actingAs($this->user)->post(route('medias.store'), [ + $response = $this->actingAs($this->user)->post(route('app.medias.store'), [ 'model' => '', 'model_id' => '', ]); @@ -65,7 +65,7 @@ 'mediable_type' => 'postPlatform', ]); - $response = $this->delete(route('medias.destroy', [$this->postPlatform->id, $media])); + $response = $this->delete(route('app.medias.destroy', [$this->postPlatform->id, $media])); $response->assertRedirect(route('login')); }); @@ -76,7 +76,7 @@ 'mediable_type' => 'postPlatform', ]); - $response = $this->actingAs($this->user)->delete(route('medias.destroy', [$this->postPlatform->id, $media])); + $response = $this->actingAs($this->user)->delete(route('app.medias.destroy', [$this->postPlatform->id, $media])); $response->assertOk(); $response->assertJson(['success' => true]); @@ -94,7 +94,7 @@ 'mediable_type' => 'postPlatform', ]); - $response = $this->actingAs($this->user)->delete(route('medias.destroy', [$this->postPlatform->id, $media])); + $response = $this->actingAs($this->user)->delete(route('app.medias.destroy', [$this->postPlatform->id, $media])); $response->assertForbidden(); }); @@ -106,7 +106,7 @@ 'mediable_type' => 'postPlatform', ]); - $response = $this->post(route('medias.duplicate', $media), [ + $response = $this->post(route('app.medias.duplicate', $media), [ 'targets' => [], ]); @@ -124,7 +124,7 @@ 'social_account_id' => $this->socialAccount->id, ]); - $response = $this->actingAs($this->user)->post(route('medias.duplicate', $media), [ + $response = $this->actingAs($this->user)->post(route('app.medias.duplicate', $media), [ 'targets' => [ [ 'model' => 'postPlatform', diff --git a/tests/Feature/Middleware/EnsureSubscribedTest.php b/tests/Feature/Middleware/EnsureSubscribedTest.php index 89f3a8b6..042cb6cd 100644 --- a/tests/Feature/Middleware/EnsureSubscribedTest.php +++ b/tests/Feature/Middleware/EnsureSubscribedTest.php @@ -13,14 +13,14 @@ $user->update(['current_workspace_id' => $workspace->id]); $this->actingAs($user) - ->get(route('calendar')) + ->get(route('app.calendar')) ->assertOk(); }); test('unauthenticated user is redirected to login', function () { config(['trypost.self_hosted' => false]); - $this->get(route('calendar')) + $this->get(route('app.calendar')) ->assertRedirect(route('login')); }); @@ -40,7 +40,7 @@ ]); $this->actingAs($user) - ->get(route('calendar')) + ->get(route('app.calendar')) ->assertOk(); }); @@ -62,7 +62,7 @@ ]); $this->actingAs($user) - ->get(route('calendar')) + ->get(route('app.calendar')) ->assertOk(); }); @@ -75,8 +75,8 @@ $user->update(['current_workspace_id' => $workspace->id]); $this->actingAs($user) - ->get(route('calendar')) - ->assertRedirect(route('subscribe')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.subscribe')); }); test('user with expired trial subscription is redirected to subscribe page', function () { @@ -98,8 +98,8 @@ ]); $this->actingAs($user) - ->get(route('calendar')) - ->assertRedirect(route('subscribe')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.subscribe')); }); test('user with cancelled subscription is redirected to subscribe page', function () { @@ -119,8 +119,8 @@ ]); $this->actingAs($user) - ->get(route('calendar')) - ->assertRedirect(route('subscribe')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.subscribe')); }); test('invited member can access workspace when owner has active subscription', function () { @@ -142,7 +142,7 @@ $member->update(['current_workspace_id' => $workspace->id]); $this->actingAs($member) - ->get(route('calendar')) + ->get(route('app.calendar')) ->assertOk(); }); @@ -158,8 +158,8 @@ $member->update(['current_workspace_id' => $workspace->id]); $this->actingAs($member) - ->get(route('calendar')) - ->assertRedirect(route('subscribe')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.subscribe')); }); test('invited member on own workspace without subscription is redirected to subscribe', function () { @@ -184,6 +184,6 @@ $member->update(['current_workspace_id' => $memberWorkspace->id]); $this->actingAs($member) - ->get(route('calendar')) - ->assertRedirect(route('subscribe')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.subscribe')); }); diff --git a/tests/Feature/Middleware/EnsureUserSetupIsCompleteTest.php b/tests/Feature/Middleware/EnsureUserSetupIsCompleteTest.php index 1e61c33c..d5e022aa 100644 --- a/tests/Feature/Middleware/EnsureUserSetupIsCompleteTest.php +++ b/tests/Feature/Middleware/EnsureUserSetupIsCompleteTest.php @@ -13,7 +13,7 @@ $user->update(['current_workspace_id' => $workspace->id]); $this->actingAs($user) - ->get(route('calendar')) + ->get(route('app.calendar')) ->assertOk(); }); @@ -26,8 +26,8 @@ $user->update(['current_workspace_id' => $workspace->id]); $this->actingAs($user) - ->get(route('calendar')) - ->assertRedirect(route('onboarding.step1')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.onboarding.step1')); }); test('user on connections step is redirected to onboarding step 2', function () { @@ -39,8 +39,8 @@ $user->update(['current_workspace_id' => $workspace->id]); $this->actingAs($user) - ->get(route('calendar')) - ->assertRedirect(route('onboarding.step2')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.onboarding.step2')); }); test('user on subscription step is redirected to onboarding step 2', function () { @@ -52,15 +52,15 @@ $user->update(['current_workspace_id' => $workspace->id]); $this->actingAs($user) - ->get(route('calendar')) - ->assertRedirect(route('onboarding.step2')); + ->get(route('app.calendar')) + ->assertRedirect(route('app.onboarding.step2')); }); test('user on role step can access onboarding step 1', function () { $user = User::factory()->create(['setup' => Setup::Role]); $this->actingAs($user) - ->get(route('onboarding.step1')) + ->get(route('app.onboarding.step1')) ->assertOk(); }); @@ -68,7 +68,7 @@ $user = User::factory()->create(['setup' => Setup::Connections]); $this->actingAs($user) - ->get(route('onboarding.step2')) + ->get(route('app.onboarding.step2')) ->assertOk(); }); @@ -76,6 +76,6 @@ $user = User::factory()->create(['setup' => Setup::Connections]); $this->actingAs($user) - ->get(route('social.linkedin.connect')) + ->get(route('app.social.linkedin.connect')) ->assertRedirect(); }); diff --git a/tests/Feature/OnboardingControllerTest.php b/tests/Feature/OnboardingControllerTest.php index 19653bcb..5f5053a6 100644 --- a/tests/Feature/OnboardingControllerTest.php +++ b/tests/Feature/OnboardingControllerTest.php @@ -13,13 +13,13 @@ // Step 1 tests test('step1 requires authentication', function () { - $response = $this->get(route('onboarding.step1')); + $response = $this->get(route('app.onboarding.step1')); $response->assertRedirect(route('login')); }); test('step1 shows persona selection', function () { - $response = $this->actingAs($this->user)->get(route('onboarding.step1')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.step1')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -30,7 +30,7 @@ // Store Step 1 tests test('store step1 requires authentication', function () { - $response = $this->post(route('onboarding.step1.store'), [ + $response = $this->post(route('app.onboarding.step1.store'), [ 'persona' => Persona::Founder->value, ]); @@ -38,11 +38,11 @@ }); test('store step1 saves persona and redirects to step2', function () { - $response = $this->actingAs($this->user)->post(route('onboarding.step1.store'), [ + $response = $this->actingAs($this->user)->post(route('app.onboarding.step1.store'), [ 'persona' => Persona::Founder->value, ]); - $response->assertRedirect(route('onboarding.step2')); + $response->assertRedirect(route('app.onboarding.step2')); $this->user->refresh(); expect($this->user->persona)->toBe(Persona::Founder); @@ -50,7 +50,7 @@ }); test('store step1 validates persona is required', function () { - $response = $this->actingAs($this->user)->post(route('onboarding.step1.store'), [ + $response = $this->actingAs($this->user)->post(route('app.onboarding.step1.store'), [ 'persona' => '', ]); @@ -58,7 +58,7 @@ }); test('store step1 validates persona is valid enum', function () { - $response = $this->actingAs($this->user)->post(route('onboarding.step1.store'), [ + $response = $this->actingAs($this->user)->post(route('app.onboarding.step1.store'), [ 'persona' => 'invalid', ]); @@ -67,7 +67,7 @@ // Step 2 tests test('step2 requires authentication', function () { - $response = $this->get(route('onboarding.step2')); + $response = $this->get(route('app.onboarding.step2')); $response->assertRedirect(route('login')); }); @@ -75,7 +75,7 @@ test('step2 shows social accounts connection', function () { $this->user->update(['setup' => Setup::Connections]); - $response = $this->actingAs($this->user)->get(route('onboarding.step2')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.step2')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -95,7 +95,7 @@ 'platform' => Platform::LinkedIn, ]); - $response = $this->actingAs($this->user)->get(route('onboarding.step2')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.step2')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -105,7 +105,7 @@ // Store Step 2 tests test('store step2 requires authentication', function () { - $response = $this->post(route('onboarding.step2.store')); + $response = $this->post(route('app.onboarding.step2.store')); $response->assertRedirect(route('login')); }); @@ -114,9 +114,9 @@ config(['trypost.self_hosted' => true]); $this->user->update(['setup' => Setup::Connections]); - $response = $this->actingAs($this->user)->post(route('onboarding.step2.store')); + $response = $this->actingAs($this->user)->post(route('app.onboarding.step2.store')); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $this->user->refresh(); expect($this->user->setup)->toBe(Setup::Completed); @@ -124,7 +124,7 @@ // Complete tests test('complete requires authentication', function () { - $response = $this->get(route('onboarding.complete')); + $response = $this->get(route('app.onboarding.complete')); $response->assertRedirect(route('login')); }); @@ -132,9 +132,9 @@ test('complete marks setup as completed', function () { $this->user->update(['setup' => Setup::Subscription]); - $response = $this->actingAs($this->user)->get(route('onboarding.complete')); + $response = $this->actingAs($this->user)->get(route('app.onboarding.complete')); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $this->user->refresh(); expect($this->user->setup)->toBe(Setup::Completed); diff --git a/tests/Feature/PostControllerTest.php b/tests/Feature/PostControllerTest.php index 1bd90411..7257f470 100644 --- a/tests/Feature/PostControllerTest.php +++ b/tests/Feature/PostControllerTest.php @@ -24,7 +24,7 @@ // Index tests test('posts index requires authentication', function () { - $response = $this->get(route('posts.index')); + $response = $this->get(route('app.posts.index')); $response->assertRedirect(route('login')); }); @@ -35,7 +35,7 @@ 'user_id' => $this->user->id, ]); - $response = $this->actingAs($this->user)->get(route('posts.index')); + $response = $this->actingAs($this->user)->get(route('app.posts.index')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -47,20 +47,20 @@ test('posts index redirects to create workspace if no workspace', function () { $this->user->update(['current_workspace_id' => null]); - $response = $this->actingAs($this->user)->get(route('posts.index')); + $response = $this->actingAs($this->user)->get(route('app.posts.index')); - $response->assertRedirect(route('workspaces.create')); + $response->assertRedirect(route('app.workspaces.create')); }); // Calendar tests test('calendar requires authentication', function () { - $response = $this->get(route('calendar')); + $response = $this->get(route('app.calendar')); $response->assertRedirect(route('login')); }); test('calendar shows posts for current week', function () { - $response = $this->actingAs($this->user)->get(route('calendar')); + $response = $this->actingAs($this->user)->get(route('app.calendar')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -73,7 +73,7 @@ }); test('calendar supports month view', function () { - $response = $this->actingAs($this->user)->get(route('calendar', ['view' => 'month'])); + $response = $this->actingAs($this->user)->get(route('app.calendar', ['view' => 'month'])); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -83,7 +83,7 @@ // Store tests test('store post requires authentication', function () { - $response = $this->post(route('posts.store')); + $response = $this->post(route('app.posts.store')); $response->assertRedirect(route('login')); }); @@ -91,13 +91,13 @@ test('store post redirects to accounts if no social accounts connected', function () { $this->socialAccount->delete(); - $response = $this->actingAs($this->user)->post(route('posts.store')); + $response = $this->actingAs($this->user)->post(route('app.posts.store')); - $response->assertRedirect(route('accounts')); + $response->assertRedirect(route('app.accounts')); }); test('store post creates draft and redirects to edit', function () { - $response = $this->actingAs($this->user)->post(route('posts.store')); + $response = $this->actingAs($this->user)->post(route('app.posts.store')); $response->assertRedirect(); @@ -114,7 +114,7 @@ 'user_id' => $this->user->id, ]); - $response = $this->get(route('posts.edit', $post)); + $response = $this->get(route('app.posts.edit', $post)); $response->assertRedirect(route('login')); }); @@ -131,7 +131,7 @@ 'social_account_id' => $this->socialAccount->id, ]); - $response = $this->actingAs($this->user)->get(route('posts.edit', $post)); + $response = $this->actingAs($this->user)->get(route('app.posts.edit', $post)); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -148,7 +148,7 @@ 'user_id' => $this->user->id, ]); - $response = $this->actingAs($this->user)->get(route('posts.edit', $post)); + $response = $this->actingAs($this->user)->get(route('app.posts.edit', $post)); $response->assertNotFound(); }); @@ -165,7 +165,7 @@ 'social_account_id' => $this->socialAccount->id, ]); - $response = $this->actingAs($this->user)->get(route('posts.edit', $post)); + $response = $this->actingAs($this->user)->get(route('app.posts.edit', $post)); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -181,7 +181,7 @@ 'user_id' => $this->user->id, ]); - $response = $this->put(route('posts.update', $post), []); + $response = $this->put(route('app.posts.update', $post), []); $response->assertRedirect(route('login')); }); @@ -199,7 +199,7 @@ 'content' => 'Original content', ]); - $response = $this->actingAs($this->user)->put(route('posts.update', $post), [ + $response = $this->actingAs($this->user)->put(route('app.posts.update', $post), [ 'status' => 'draft', 'platforms' => [ [ @@ -223,7 +223,7 @@ 'status' => PostStatus::Published, ]); - $response = $this->actingAs($this->user)->put(route('posts.update', $post), [ + $response = $this->actingAs($this->user)->put(route('app.posts.update', $post), [ 'status' => 'draft', ]); @@ -246,7 +246,7 @@ 'content' => 'Test content', ]); - $response = $this->actingAs($this->user)->put(route('posts.update', $post), [ + $response = $this->actingAs($this->user)->put(route('app.posts.update', $post), [ 'status' => 'publishing', 'platforms' => [ [ @@ -270,7 +270,7 @@ 'user_id' => $this->user->id, ]); - $response = $this->delete(route('posts.destroy', $post)); + $response = $this->delete(route('app.posts.destroy', $post)); $response->assertRedirect(route('login')); }); @@ -282,10 +282,10 @@ ]); $response = $this->actingAs($this->user) - ->from(route('calendar')) - ->delete(route('posts.destroy', $post)); + ->from(route('app.calendar')) + ->delete(route('app.posts.destroy', $post)); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); expect(Post::find($post->id))->toBeNull(); }); @@ -296,10 +296,10 @@ ]); $response = $this->actingAs($this->user) - ->from(route('posts.index', ['status' => $status])) - ->delete(route('posts.destroy', $post)); + ->from(route('app.posts.index', ['status' => $status])) + ->delete(route('app.posts.destroy', $post)); - $response->assertRedirect(route('posts.index', ['status' => $status])); + $response->assertRedirect(route('app.posts.index', ['status' => $status])); expect(Post::find($post->id))->toBeNull(); })->with(['draft', 'scheduled', 'published']); @@ -310,9 +310,9 @@ ]); $response = $this->actingAs($this->user) - ->delete(route('posts.destroy', $post).'?redirect=posts.index'); + ->delete(route('app.posts.destroy', $post).'?redirect=app.posts.index'); - $response->assertRedirect(route('posts.index')); + $response->assertRedirect(route('app.posts.index')); expect(Post::find($post->id))->toBeNull(); }); @@ -323,7 +323,7 @@ 'user_id' => $this->user->id, ]); - $response = $this->actingAs($this->user)->delete(route('posts.destroy', $post)); + $response = $this->actingAs($this->user)->delete(route('app.posts.destroy', $post)); $response->assertNotFound(); }); @@ -347,7 +347,7 @@ 'color' => '#FF0000', ]); - $response = $this->actingAs($this->user)->get(route('posts.edit', $post)); + $response = $this->actingAs($this->user)->get(route('app.posts.edit', $post)); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -373,7 +373,7 @@ 'workspace_id' => $this->workspace->id, ]); - $response = $this->actingAs($this->user)->put(route('posts.update', $post), [ + $response = $this->actingAs($this->user)->put(route('app.posts.update', $post), [ 'status' => 'draft', 'platforms' => [ [ @@ -410,7 +410,7 @@ $post->labels()->attach($label); - $response = $this->actingAs($this->user)->put(route('posts.update', $post), [ + $response = $this->actingAs($this->user)->put(route('app.posts.update', $post), [ 'status' => 'draft', 'platforms' => [ [ @@ -448,7 +448,7 @@ $post->labels()->attach($label1); // Update with different labels - $response = $this->actingAs($this->user)->put(route('posts.update', $post), [ + $response = $this->actingAs($this->user)->put(route('app.posts.update', $post), [ 'status' => 'draft', 'platforms' => [ [ @@ -479,7 +479,7 @@ 'social_account_id' => $this->socialAccount->id, ]); - $response = $this->actingAs($this->user)->put(route('posts.update', $post), [ + $response = $this->actingAs($this->user)->put(route('app.posts.update', $post), [ 'status' => 'draft', 'platforms' => [ [ diff --git a/tests/Feature/Settings/PasswordUpdateTest.php b/tests/Feature/Settings/PasswordUpdateTest.php index 4e53a91c..08d1fef9 100644 --- a/tests/Feature/Settings/PasswordUpdateTest.php +++ b/tests/Feature/Settings/PasswordUpdateTest.php @@ -8,7 +8,7 @@ $response = $this ->actingAs($user) - ->get(route('user-password.edit')); + ->get(route('app.user-password.edit')); $response->assertOk(); }); @@ -18,8 +18,8 @@ $response = $this ->actingAs($user) - ->from(route('user-password.edit')) - ->put(route('user-password.update'), [ + ->from(route('app.user-password.edit')) + ->put(route('app.user-password.update'), [ 'current_password' => 'password', 'password' => 'new-password', 'password_confirmation' => 'new-password', @@ -27,7 +27,7 @@ $response ->assertSessionHasNoErrors() - ->assertRedirect(route('user-password.edit')); + ->assertRedirect(route('app.user-password.edit')); expect(Hash::check('new-password', $user->refresh()->password))->toBeTrue(); }); @@ -37,8 +37,8 @@ $response = $this ->actingAs($user) - ->from(route('user-password.edit')) - ->put(route('user-password.update'), [ + ->from(route('app.user-password.edit')) + ->put(route('app.user-password.update'), [ 'current_password' => 'wrong-password', 'password' => 'new-password', 'password_confirmation' => 'new-password', @@ -46,5 +46,5 @@ $response ->assertSessionHasErrors('current_password') - ->assertRedirect(route('user-password.edit')); -}); \ No newline at end of file + ->assertRedirect(route('app.user-password.edit')); +}); diff --git a/tests/Feature/Settings/ProfileUpdateTest.php b/tests/Feature/Settings/ProfileUpdateTest.php index f4399214..336524d8 100644 --- a/tests/Feature/Settings/ProfileUpdateTest.php +++ b/tests/Feature/Settings/ProfileUpdateTest.php @@ -1,14 +1,16 @@ create(); $response = $this ->actingAs($user) - ->get(route('profile.edit')); + ->get(route('app.profile.edit')); $response->assertOk(); }); @@ -18,14 +20,14 @@ $response = $this ->actingAs($user) - ->patch(route('profile.update'), [ + ->patch(route('app.profile.update'), [ 'name' => 'Test User', 'email' => 'test@example.com', ]); $response ->assertSessionHasNoErrors() - ->assertRedirect(route('profile.edit')); + ->assertRedirect(route('app.profile.edit')); $user->refresh(); @@ -39,14 +41,14 @@ $response = $this ->actingAs($user) - ->patch(route('profile.update'), [ + ->patch(route('app.profile.update'), [ 'name' => 'Test User', 'email' => $user->email, ]); $response ->assertSessionHasNoErrors() - ->assertRedirect(route('profile.edit')); + ->assertRedirect(route('app.profile.edit')); expect($user->refresh()->email_verified_at)->not->toBeNull(); }); @@ -57,14 +59,14 @@ $response = $this ->actingAs($user) - ->from(route('posts.index')) - ->patch(route('profile.language'), [ + ->from(route('app.posts.index')) + ->patch(route('app.profile.language'), [ 'language_id' => $newLanguage->id, ]); $response ->assertSessionHasNoErrors() - ->assertRedirect(route('posts.index')); + ->assertRedirect(route('app.posts.index')); expect($user->refresh()->language_id)->toBe($newLanguage->id); }); @@ -74,7 +76,7 @@ $response = $this ->actingAs($user) - ->patch(route('profile.language'), [ + ->patch(route('app.profile.language'), [ 'language_id' => '00000000-0000-0000-0000-000000000000', ]); @@ -86,13 +88,13 @@ $response = $this ->actingAs($user) - ->delete(route('profile.destroy'), [ + ->delete(route('app.profile.destroy'), [ 'password' => 'password', ]); $response ->assertSessionHasNoErrors() - ->assertRedirect(route('home')); + ->assertRedirect(route('app.home')); $this->assertGuest(); expect($user->fresh())->toBeNull(); @@ -103,14 +105,14 @@ $response = $this ->actingAs($user) - ->from(route('profile.edit')) - ->delete(route('profile.destroy'), [ + ->from(route('app.profile.edit')) + ->delete(route('app.profile.destroy'), [ 'password' => 'wrong-password', ]); $response ->assertSessionHasErrors('password') - ->assertRedirect(route('profile.edit')); + ->assertRedirect(route('app.profile.edit')); expect($user->fresh())->not->toBeNull(); }); @@ -120,12 +122,12 @@ $member = User::factory()->create(); // Create a workspace owned by the owner - $workspace = \App\Models\Workspace::factory()->create(['user_id' => $owner->id]); - $owner->workspaces()->attach($workspace->id, ['role' => \App\Enums\UserWorkspace\Role::Owner->value]); + $workspace = Workspace::factory()->create(['user_id' => $owner->id]); + $owner->workspaces()->attach($workspace->id, ['role' => Role::Owner->value]); $owner->update(['current_workspace_id' => $workspace->id]); // Add member to the workspace and set it as their current - $member->workspaces()->attach($workspace->id, ['role' => \App\Enums\UserWorkspace\Role::Member->value]); + $member->workspaces()->attach($workspace->id, ['role' => Role::Member->value]); $member->update(['current_workspace_id' => $workspace->id]); // Verify setup @@ -134,7 +136,7 @@ // Owner deletes their account $this ->actingAs($owner) - ->delete(route('profile.destroy'), [ + ->delete(route('app.profile.destroy'), [ 'password' => 'password', ]); @@ -148,17 +150,17 @@ $otherOwner = User::factory()->create(); // Create workspace owned by the owner being deleted - $workspaceToDelete = \App\Models\Workspace::factory()->create(['user_id' => $owner->id]); - $owner->workspaces()->attach($workspaceToDelete->id, ['role' => \App\Enums\UserWorkspace\Role::Owner->value]); + $workspaceToDelete = Workspace::factory()->create(['user_id' => $owner->id]); + $owner->workspaces()->attach($workspaceToDelete->id, ['role' => Role::Owner->value]); $owner->update(['current_workspace_id' => $workspaceToDelete->id]); // Create another workspace owned by a different user - $otherWorkspace = \App\Models\Workspace::factory()->create(['user_id' => $otherOwner->id]); - $otherOwner->workspaces()->attach($otherWorkspace->id, ['role' => \App\Enums\UserWorkspace\Role::Owner->value]); + $otherWorkspace = Workspace::factory()->create(['user_id' => $otherOwner->id]); + $otherOwner->workspaces()->attach($otherWorkspace->id, ['role' => Role::Owner->value]); // Add member to both workspaces - $member->workspaces()->attach($workspaceToDelete->id, ['role' => \App\Enums\UserWorkspace\Role::Member->value]); - $member->workspaces()->attach($otherWorkspace->id, ['role' => \App\Enums\UserWorkspace\Role::Member->value]); + $member->workspaces()->attach($workspaceToDelete->id, ['role' => Role::Member->value]); + $member->workspaces()->attach($otherWorkspace->id, ['role' => Role::Member->value]); $member->update(['current_workspace_id' => $workspaceToDelete->id]); // Verify setup @@ -167,7 +169,7 @@ // Owner deletes their account $this ->actingAs($owner) - ->delete(route('profile.destroy'), [ + ->delete(route('app.profile.destroy'), [ 'password' => 'password', ]); diff --git a/tests/Feature/Social/BlueskyControllerTest.php b/tests/Feature/Social/BlueskyControllerTest.php index 5d6165bd..6c79192d 100644 --- a/tests/Feature/Social/BlueskyControllerTest.php +++ b/tests/Feature/Social/BlueskyControllerTest.php @@ -15,7 +15,7 @@ }); test('bluesky connect page can be rendered', function () { - $response = $this->actingAs($this->user)->get(route('social.bluesky.connect')); + $response = $this->actingAs($this->user)->get(route('app.social.bluesky.connect')); $response->assertOk(); }); @@ -36,7 +36,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->post(route('social.bluesky.store'), [ + $response = $this->actingAs($this->user)->post(route('app.social.bluesky.store'), [ 'identifier' => 'testuser.bsky.social', 'password' => 'xxxx-xxxx-xxxx-xxxx', ]); @@ -62,7 +62,7 @@ ], 401), ]); - $response = $this->actingAs($this->user)->post(route('social.bluesky.store'), [ + $response = $this->actingAs($this->user)->post(route('app.social.bluesky.store'), [ 'identifier' => 'testuser.bsky.social', 'password' => 'wrong-password', ]); @@ -96,7 +96,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->post(route('social.bluesky.store'), [ + $response = $this->actingAs($this->user)->post(route('app.social.bluesky.store'), [ 'identifier' => 'newuser.bsky.social', 'password' => 'xxxx-xxxx-xxxx-xxxx', ]); @@ -127,7 +127,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->post(route('social.bluesky.store'), [ + $response = $this->actingAs($this->user)->post(route('app.social.bluesky.store'), [ 'identifier' => 'testuser.bsky.social', 'password' => 'xxxx-xxxx-xxxx-xxxx', ]); @@ -141,7 +141,7 @@ }); test('bluesky connection validates required fields', function () { - $response = $this->actingAs($this->user)->post(route('social.bluesky.store'), [ + $response = $this->actingAs($this->user)->post(route('app.social.bluesky.store'), [ 'identifier' => '', 'password' => '', ]); diff --git a/tests/Feature/Social/FacebookControllerTest.php b/tests/Feature/Social/FacebookControllerTest.php index 16ba4fbf..9d904027 100644 --- a/tests/Feature/Social/FacebookControllerTest.php +++ b/tests/Feature/Social/FacebookControllerTest.php @@ -28,7 +28,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.facebook.connect')); + ->get(route('app.social.facebook.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -64,7 +64,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.facebook.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.facebook.callback')); $response->assertOk(); $response->assertViewIs('auth.social-callback'); @@ -116,9 +116,9 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.facebook.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.facebook.callback')); - $response->assertRedirect(route('social.facebook.select-page')); + $response->assertRedirect(route('app.social.facebook.select-page')); expect(session('facebook_oauth'))->not->toBeNull(); }); @@ -143,7 +143,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.facebook.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.facebook.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -153,7 +153,7 @@ test('facebook callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.facebook.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.facebook.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -193,7 +193,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.facebook.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.facebook.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -236,7 +236,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.facebook.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.facebook.callback')); $response->assertOk(); $response->assertViewHas('success', true); @@ -252,13 +252,13 @@ ]); $mock = Mockery::mock(); - $mock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $mock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('facebook') ->andReturn($mock); - $response = $this->actingAs($this->user)->get(route('social.facebook.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.facebook.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -290,7 +290,7 @@ ], ]); - $response = $this->actingAs($this->user)->post(route('social.facebook.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.facebook.select'), [ 'page_id' => 'page_123', ]); @@ -308,7 +308,7 @@ test('facebook page selection fails with expired session', function () { // No session data - $response = $this->actingAs($this->user)->post(route('social.facebook.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.facebook.select'), [ 'page_id' => 'page_123', ]); @@ -334,7 +334,7 @@ ], ]); - $response = $this->actingAs($this->user)->post(route('social.facebook.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.facebook.select'), [ 'page_id' => 'invalid_page_id', ]); diff --git a/tests/Feature/Social/InstagramControllerTest.php b/tests/Feature/Social/InstagramControllerTest.php index 120e6bee..007c5697 100644 --- a/tests/Feature/Social/InstagramControllerTest.php +++ b/tests/Feature/Social/InstagramControllerTest.php @@ -27,7 +27,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.instagram.connect')); + ->get(route('app.social.instagram.connect')); $response->assertStatus(409); @@ -55,7 +55,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.instagram.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.instagram.callback')); $response->assertOk(); $response->assertViewIs('auth.social-callback'); @@ -71,7 +71,7 @@ }); test('instagram callback fails with expired session', function () { - $response = $this->actingAs($this->user)->get(route('social.instagram.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.instagram.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -106,7 +106,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.instagram.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.instagram.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -141,7 +141,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.instagram.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.instagram.callback')); $response->assertOk(); $response->assertViewHas('success', true); @@ -157,13 +157,13 @@ ]); $mock = Mockery::mock(); - $mock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $mock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('instagram') ->andReturn($mock); - $response = $this->actingAs($this->user)->get(route('social.instagram.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.instagram.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -173,7 +173,7 @@ test('instagram connect redirects to create workspace if none exists', function () { $this->user->update(['current_workspace_id' => null]); - $response = $this->actingAs($this->user)->get(route('social.instagram.connect')); + $response = $this->actingAs($this->user)->get(route('app.social.instagram.connect')); - $response->assertRedirect(route('workspaces.create')); + $response->assertRedirect(route('app.workspaces.create')); }); diff --git a/tests/Feature/Social/LinkedInControllerTest.php b/tests/Feature/Social/LinkedInControllerTest.php index 5629773c..da540dae 100644 --- a/tests/Feature/Social/LinkedInControllerTest.php +++ b/tests/Feature/Social/LinkedInControllerTest.php @@ -28,7 +28,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.linkedin.connect')); + ->get(route('app.social.linkedin.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -65,7 +65,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.linkedin.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin.callback')); $response->assertOk(); $response->assertViewIs('auth.social-callback'); @@ -83,7 +83,7 @@ test('linkedin callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.linkedin.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -115,7 +115,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.linkedin.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -154,7 +154,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.linkedin.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin.callback')); $response->assertOk(); $response->assertViewHas('success', true); @@ -170,13 +170,13 @@ ]); $mock = Mockery::mock(); - $mock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $mock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('linkedin') ->andReturn($mock); - $response = $this->actingAs($this->user)->get(route('social.linkedin.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin.callback')); $response->assertOk(); $response->assertViewHas('success', false); diff --git a/tests/Feature/Social/LinkedInPageControllerTest.php b/tests/Feature/Social/LinkedInPageControllerTest.php index 84fc110b..37ba3026 100644 --- a/tests/Feature/Social/LinkedInPageControllerTest.php +++ b/tests/Feature/Social/LinkedInPageControllerTest.php @@ -29,7 +29,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.linkedin-page.connect')); + ->get(route('app.social.linkedin-page.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -72,9 +72,9 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.linkedin-page.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin-page.callback')); - $response->assertRedirect(route('social.linkedin-page.select-page')); + $response->assertRedirect(route('app.social.linkedin-page.select-page')); expect(session('linkedin_page_pending'))->not->toBeNull(); expect(session('linkedin_page_pending.organizations'))->toHaveCount(1); @@ -108,7 +108,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.linkedin-page.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin-page.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -118,7 +118,7 @@ test('linkedin page callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.linkedin-page.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin-page.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -141,7 +141,7 @@ ], ]); - $response = $this->actingAs($this->user)->post(route('social.linkedin-page.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.linkedin-page.select'), [ 'organization_id' => 123456, 'organization_name' => 'Test Company', 'organization_vanity_name' => 'testcompany', @@ -165,7 +165,7 @@ test('linkedin page select fails with expired session', function () { // No session data - $response = $this->actingAs($this->user)->post(route('social.linkedin-page.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.linkedin-page.select'), [ 'organization_id' => 123456, 'organization_name' => 'Test Company', 'organization_vanity_name' => 'testcompany', @@ -183,7 +183,7 @@ ]); // The "already connected" check happens in the connect method, not callback - $response = $this->actingAs($this->user)->get(route('social.linkedin-page.connect')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin-page.connect')); $response->assertRedirect(); $response->assertSessionHas('flash.banner', __('accounts.flash.already_connected')); @@ -212,7 +212,7 @@ ], ]); - $response = $this->actingAs($this->user)->post(route('social.linkedin-page.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.linkedin-page.select'), [ 'organization_id' => 123456, 'organization_name' => 'Test Company', 'organization_vanity_name' => 'testcompany', @@ -235,13 +235,13 @@ $socialiteMock = Mockery::mock(); $socialiteMock->shouldReceive('scopes')->andReturn($socialiteMock); $socialiteMock->shouldReceive('with')->andReturn($socialiteMock); - $socialiteMock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $socialiteMock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('linkedin-openid') ->andReturn($socialiteMock); - $response = $this->actingAs($this->user)->get(route('social.linkedin-page.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.linkedin-page.callback')); $response->assertOk(); $response->assertViewHas('success', false); diff --git a/tests/Feature/Social/MastodonControllerTest.php b/tests/Feature/Social/MastodonControllerTest.php index 92d3f8c4..57111ade 100644 --- a/tests/Feature/Social/MastodonControllerTest.php +++ b/tests/Feature/Social/MastodonControllerTest.php @@ -15,7 +15,7 @@ }); test('mastodon connect page can be rendered', function () { - $response = $this->actingAs($this->user)->get(route('social.mastodon.connect')); + $response = $this->actingAs($this->user)->get(route('app.social.mastodon.connect')); $response->assertOk(); }); @@ -27,13 +27,13 @@ 'client_secret' => 'test-client-secret', 'id' => '12345', 'name' => config('app.name'), - 'redirect_uri' => route('social.mastodon.callback'), + 'redirect_uri' => route('app.social.mastodon.callback'), ], 200), ]); $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->post(route('social.mastodon.authorize'), [ + ->post(route('app.social.mastodon.authorize'), [ 'instance' => 'https://mastodon.social', ]); @@ -49,7 +49,7 @@ 'https://invalid-instance.com/api/v1/apps' => Http::response([], 404), ]); - $response = $this->actingAs($this->user)->post(route('social.mastodon.authorize'), [ + $response = $this->actingAs($this->user)->post(route('app.social.mastodon.authorize'), [ 'instance' => 'https://invalid-instance.com', ]); @@ -83,7 +83,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.mastodon.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.mastodon.callback', [ 'code' => 'test-auth-code', 'state' => 'test-state', ])); @@ -110,7 +110,7 @@ 'social_connect_workspace' => $this->workspace->id, ]); - $response = $this->actingAs($this->user)->get(route('social.mastodon.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.mastodon.callback', [ 'code' => 'test-auth-code', 'state' => 'wrong-state', ])); @@ -127,7 +127,7 @@ test('mastodon callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.mastodon.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.mastodon.callback', [ 'code' => 'test-auth-code', 'state' => 'test-state', ])); @@ -164,7 +164,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.mastodon.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.mastodon.callback', [ 'code' => 'test-auth-code', 'state' => 'test-state', ])); @@ -201,7 +201,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.mastodon.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.mastodon.callback', [ 'code' => 'test-auth-code', 'state' => 'test-state', ])); @@ -215,7 +215,7 @@ }); test('mastodon connection validates instance url', function () { - $response = $this->actingAs($this->user)->post(route('social.mastodon.authorize'), [ + $response = $this->actingAs($this->user)->post(route('app.social.mastodon.authorize'), [ 'instance' => 'not-a-valid-url', ]); @@ -234,7 +234,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->post(route('social.mastodon.authorize'), [ + ->post(route('app.social.mastodon.authorize'), [ 'instance' => 'https://techhub.social', ]); diff --git a/tests/Feature/Social/PinterestControllerTest.php b/tests/Feature/Social/PinterestControllerTest.php index f8945740..b318b946 100644 --- a/tests/Feature/Social/PinterestControllerTest.php +++ b/tests/Feature/Social/PinterestControllerTest.php @@ -27,7 +27,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.pinterest.connect')); + ->get(route('app.social.pinterest.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -55,7 +55,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.pinterest.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.pinterest.callback')); $response->assertOk(); $response->assertViewIs('auth.social-callback'); @@ -73,7 +73,7 @@ test('pinterest callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.pinterest.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.pinterest.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -105,7 +105,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.pinterest.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.pinterest.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -138,7 +138,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.pinterest.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.pinterest.callback')); $response->assertOk(); $response->assertViewHas('success', true); @@ -154,13 +154,13 @@ ]); $mock = Mockery::mock(); - $mock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $mock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('pinterest') ->andReturn($mock); - $response = $this->actingAs($this->user)->get(route('social.pinterest.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.pinterest.callback')); $response->assertOk(); $response->assertViewHas('success', false); diff --git a/tests/Feature/Social/ThreadsControllerTest.php b/tests/Feature/Social/ThreadsControllerTest.php index cb353f92..edfee4d0 100644 --- a/tests/Feature/Social/ThreadsControllerTest.php +++ b/tests/Feature/Social/ThreadsControllerTest.php @@ -17,7 +17,7 @@ test('threads connect redirects to oauth', function () { $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.threads.connect')); + ->get(route('app.social.threads.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -50,7 +50,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.threads.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.threads.callback', [ 'code' => 'test-auth-code', 'state' => $state, ])); @@ -74,7 +74,7 @@ 'threads_oauth_state' => 'correct-state', ]); - $response = $this->actingAs($this->user)->get(route('social.threads.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.threads.callback', [ 'code' => 'test-auth-code', 'state' => 'wrong-state', ])); @@ -92,7 +92,7 @@ test('threads callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.threads.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.threads.callback', [ 'code' => 'test-auth-code', 'state' => 'test-state', ])); @@ -131,7 +131,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.threads.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.threads.callback', [ 'code' => 'test-auth-code', 'state' => $state, ])); @@ -171,7 +171,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.threads.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.threads.callback', [ 'code' => 'test-auth-code', 'state' => $state, ])); @@ -199,7 +199,7 @@ ], 400), ]); - $response = $this->actingAs($this->user)->get(route('social.threads.callback', [ + $response = $this->actingAs($this->user)->get(route('app.social.threads.callback', [ 'code' => 'expired-auth-code', 'state' => $state, ])); diff --git a/tests/Feature/Social/TikTokControllerTest.php b/tests/Feature/Social/TikTokControllerTest.php index e5bfafa4..d20bf679 100644 --- a/tests/Feature/Social/TikTokControllerTest.php +++ b/tests/Feature/Social/TikTokControllerTest.php @@ -27,7 +27,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.tiktok.connect')); + ->get(route('app.social.tiktok.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -57,7 +57,7 @@ ->with('tiktok') ->andReturn($socialiteMock); - $response = $this->actingAs($this->user)->get(route('social.tiktok.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.tiktok.callback')); $response->assertOk(); $response->assertViewIs('auth.social-callback'); @@ -75,7 +75,7 @@ test('tiktok callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.tiktok.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.tiktok.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -109,7 +109,7 @@ ->with('tiktok') ->andReturn($socialiteMock); - $response = $this->actingAs($this->user)->get(route('social.tiktok.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.tiktok.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -145,7 +145,7 @@ ->with('tiktok') ->andReturn($socialiteMock); - $response = $this->actingAs($this->user)->get(route('social.tiktok.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.tiktok.callback')); $response->assertOk(); $response->assertViewHas('success', true); @@ -162,13 +162,13 @@ $mock = Mockery::mock(); $mock->shouldReceive('scopes')->andReturn($mock); - $mock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $mock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('tiktok') ->andReturn($mock); - $response = $this->actingAs($this->user)->get(route('social.tiktok.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.tiktok.callback')); $response->assertOk(); $response->assertViewHas('success', false); diff --git a/tests/Feature/Social/XControllerTest.php b/tests/Feature/Social/XControllerTest.php index 39635c09..92c7fc91 100644 --- a/tests/Feature/Social/XControllerTest.php +++ b/tests/Feature/Social/XControllerTest.php @@ -27,7 +27,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.x.connect')); + ->get(route('app.social.x.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -55,7 +55,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.x.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.x.callback')); $response->assertOk(); $response->assertViewIs('auth.social-callback'); @@ -73,7 +73,7 @@ test('x callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.x.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.x.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -105,7 +105,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.x.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.x.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -138,7 +138,7 @@ 'user' => $socialiteUser, ])); - $response = $this->actingAs($this->user)->get(route('social.x.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.x.callback')); $response->assertOk(); $response->assertViewHas('success', true); @@ -154,13 +154,13 @@ ]); $mock = Mockery::mock(); - $mock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $mock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('x') ->andReturn($mock); - $response = $this->actingAs($this->user)->get(route('social.x.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.x.callback')); $response->assertOk(); $response->assertViewHas('success', false); diff --git a/tests/Feature/Social/YouTubeControllerTest.php b/tests/Feature/Social/YouTubeControllerTest.php index f29da189..e51d8261 100644 --- a/tests/Feature/Social/YouTubeControllerTest.php +++ b/tests/Feature/Social/YouTubeControllerTest.php @@ -29,7 +29,7 @@ $response = $this->actingAs($this->user) ->withHeader('X-Inertia', 'true') - ->get(route('social.youtube.connect')); + ->get(route('app.social.youtube.connect')); $response->assertStatus(409); // Inertia::location returns 409 with X-Inertia header @@ -74,7 +74,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.youtube.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.youtube.callback')); $response->assertOk(); $response->assertViewIs('auth.social-callback'); @@ -132,9 +132,9 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.youtube.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.youtube.callback')); - $response->assertRedirect(route('social.youtube.select-channel')); + $response->assertRedirect(route('app.social.youtube.select-channel')); expect(session('youtube_oauth'))->not->toBeNull(); }); @@ -161,7 +161,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.youtube.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.youtube.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -171,7 +171,7 @@ test('youtube callback fails with expired session', function () { // No session data - simulating expired session - $response = $this->actingAs($this->user)->get(route('social.youtube.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.youtube.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -216,7 +216,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.youtube.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.youtube.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -263,7 +263,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->get(route('social.youtube.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.youtube.callback')); $response->assertOk(); $response->assertViewHas('success', true); @@ -279,13 +279,13 @@ ]); $mock = Mockery::mock(); - $mock->shouldReceive('user')->andThrow(new \Exception('OAuth error')); + $mock->shouldReceive('user')->andThrow(new Exception('OAuth error')); Socialite::shouldReceive('driver') ->with('google') ->andReturn($mock); - $response = $this->actingAs($this->user)->get(route('social.youtube.callback')); + $response = $this->actingAs($this->user)->get(route('app.social.youtube.callback')); $response->assertOk(); $response->assertViewHas('success', false); @@ -320,7 +320,7 @@ ], 200), ]); - $response = $this->actingAs($this->user)->post(route('social.youtube.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.youtube.select'), [ 'channel_id' => 'UC_channel_123', ]); @@ -338,7 +338,7 @@ test('youtube channel selection fails with expired session', function () { // No session data - $response = $this->actingAs($this->user)->post(route('social.youtube.select'), [ + $response = $this->actingAs($this->user)->post(route('app.social.youtube.select'), [ 'channel_id' => 'UC_channel_123', ]); diff --git a/tests/Feature/SocialControllerTest.php b/tests/Feature/SocialControllerTest.php index 12076992..516bc035 100644 --- a/tests/Feature/SocialControllerTest.php +++ b/tests/Feature/SocialControllerTest.php @@ -14,7 +14,7 @@ // Index tests test('accounts index requires authentication', function () { - $response = $this->get(route('accounts')); + $response = $this->get(route('app.accounts')); $response->assertRedirect(route('login')); }); @@ -25,7 +25,7 @@ 'platform' => Platform::LinkedIn, ]); - $response = $this->actingAs($this->user)->get(route('accounts')); + $response = $this->actingAs($this->user)->get(route('app.accounts')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -38,16 +38,16 @@ test('accounts index redirects if no workspace', function () { $this->user->update(['current_workspace_id' => null]); - $response = $this->actingAs($this->user)->get(route('accounts')); + $response = $this->actingAs($this->user)->get(route('app.accounts')); - $response->assertRedirect(route('workspaces.create')); + $response->assertRedirect(route('app.workspaces.create')); }); // Disconnect tests test('disconnect requires authentication', function () { $account = SocialAccount::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->delete(route('accounts.disconnect', $account)); + $response = $this->delete(route('app.accounts.disconnect', $account)); $response->assertRedirect(route('login')); }); @@ -55,7 +55,7 @@ test('disconnect removes social account', function () { $account = SocialAccount::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->actingAs($this->user)->delete(route('accounts.disconnect', $account)); + $response = $this->actingAs($this->user)->delete(route('app.accounts.disconnect', $account)); $response->assertRedirect(); expect(SocialAccount::find($account->id))->toBeNull(); @@ -65,7 +65,7 @@ $otherWorkspace = Workspace::factory()->create(); $account = SocialAccount::factory()->create(['workspace_id' => $otherWorkspace->id]); - $response = $this->actingAs($this->user)->delete(route('accounts.disconnect', $account)); + $response = $this->actingAs($this->user)->delete(route('app.accounts.disconnect', $account)); $response->assertForbidden(); }); diff --git a/tests/Feature/VerifyWorkspaceConnectionsTest.php b/tests/Feature/VerifyWorkspaceConnectionsTest.php index b39592a1..b2ff3018 100644 --- a/tests/Feature/VerifyWorkspaceConnectionsTest.php +++ b/tests/Feature/VerifyWorkspaceConnectionsTest.php @@ -94,10 +94,10 @@ $verifier = mock(ConnectionVerifier::class); $verifier->shouldReceive('verify') - ->with(\Mockery::on(fn ($acc) => $acc->id === $validAccount->id)) + ->with(Mockery::on(fn ($acc) => $acc->id === $validAccount->id)) ->andReturn(true); $verifier->shouldReceive('verify') - ->with(\Mockery::on(fn ($acc) => $acc->id === $invalidAccount->id)) + ->with(Mockery::on(fn ($acc) => $acc->id === $invalidAccount->id)) ->andThrow(new TokenExpiredException('Token expired')); app()->instance(ConnectionVerifier::class, $verifier); diff --git a/tests/Feature/WorkspaceControllerTest.php b/tests/Feature/WorkspaceControllerTest.php index 0c8b37f8..b00a50ca 100644 --- a/tests/Feature/WorkspaceControllerTest.php +++ b/tests/Feature/WorkspaceControllerTest.php @@ -13,7 +13,7 @@ // Index tests test('workspaces index requires authentication', function () { - $response = $this->get(route('workspaces.index')); + $response = $this->get(route('app.workspaces.index')); $response->assertRedirect(route('login')); }); @@ -24,7 +24,7 @@ $workspace->members()->attach($this->user->id, ['role' => 'owner']); } - $response = $this->actingAs($this->user)->get(route('workspaces.index')); + $response = $this->actingAs($this->user)->get(route('app.workspaces.index')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -36,7 +36,7 @@ // Create tests test('create workspace requires authentication', function () { - $response = $this->get(route('workspaces.create')); + $response = $this->get(route('app.workspaces.create')); $response->assertRedirect(route('login')); }); @@ -46,7 +46,7 @@ $this->user->update(['current_workspace_id' => null]); $this->workspace->delete(); - $response = $this->actingAs($this->user)->get(route('workspaces.create')); + $response = $this->actingAs($this->user)->get(route('app.workspaces.create')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -57,7 +57,7 @@ test('create workspace shows form when user already has workspace in self-hosted mode', function () { config(['trypost.self_hosted' => true]); - $response = $this->actingAs($this->user)->get(route('workspaces.create')); + $response = $this->actingAs($this->user)->get(route('app.workspaces.create')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -67,7 +67,7 @@ // Store tests test('store workspace requires authentication', function () { - $response = $this->post(route('workspaces.store'), ['name' => 'Test Workspace']); + $response = $this->post(route('app.workspaces.store'), ['name' => 'Test Workspace']); $response->assertRedirect(route('login')); }); @@ -77,11 +77,11 @@ $this->user->update(['current_workspace_id' => null]); $this->workspace->delete(); - $response = $this->actingAs($this->user)->post(route('workspaces.store'), [ + $response = $this->actingAs($this->user)->post(route('app.workspaces.store'), [ 'name' => 'New Workspace', ]); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $this->assertDatabaseHas('workspaces', [ 'name' => 'New Workspace', @@ -92,11 +92,11 @@ test('store workspace creates second workspace in self-hosted mode', function () { config(['trypost.self_hosted' => true]); - $response = $this->actingAs($this->user)->post(route('workspaces.store'), [ + $response = $this->actingAs($this->user)->post(route('app.workspaces.store'), [ 'name' => 'Second Workspace', ]); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $this->assertDatabaseHas('workspaces', [ 'name' => 'Second Workspace', @@ -105,7 +105,7 @@ }); test('store workspace validates name is required', function () { - $response = $this->actingAs($this->user)->post(route('workspaces.store'), [ + $response = $this->actingAs($this->user)->post(route('app.workspaces.store'), [ 'name' => '', ]); @@ -117,7 +117,7 @@ $this->user->update(['current_workspace_id' => null]); $this->workspace->delete(); - $this->actingAs($this->user)->post(route('workspaces.store'), [ + $this->actingAs($this->user)->post(route('app.workspaces.store'), [ 'name' => 'New Workspace', ]); @@ -129,7 +129,7 @@ // Switch tests test('switch workspace requires authentication', function () { - $response = $this->post(route('workspaces.switch', $this->workspace)); + $response = $this->post(route('app.workspaces.switch', $this->workspace)); $response->assertRedirect(route('login')); }); @@ -138,9 +138,9 @@ $otherWorkspace = Workspace::factory()->create(['user_id' => $this->user->id]); $otherWorkspace->members()->attach($this->user->id, ['role' => 'owner']); - $response = $this->actingAs($this->user)->post(route('workspaces.switch', $otherWorkspace)); + $response = $this->actingAs($this->user)->post(route('app.workspaces.switch', $otherWorkspace)); - $response->assertRedirect(route('calendar')); + $response->assertRedirect(route('app.calendar')); $this->user->refresh(); expect($this->user->current_workspace_id)->toBe($otherWorkspace->id); @@ -150,20 +150,20 @@ $otherUser = User::factory()->create(['setup' => Setup::Completed]); $otherWorkspace = Workspace::factory()->create(['user_id' => $otherUser->id]); - $response = $this->actingAs($this->user)->post(route('workspaces.switch', $otherWorkspace)); + $response = $this->actingAs($this->user)->post(route('app.workspaces.switch', $otherWorkspace)); $response->assertForbidden(); }); // Settings tests test('workspace settings requires authentication', function () { - $response = $this->get(route('workspace.settings')); + $response = $this->get(route('app.workspace.settings')); $response->assertRedirect(route('login')); }); test('workspace settings shows settings page', function () { - $response = $this->actingAs($this->user)->get(route('workspace.settings')); + $response = $this->actingAs($this->user)->get(route('app.workspace.settings')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -176,14 +176,14 @@ test('workspace settings redirects to create if no workspace', function () { $this->user->update(['current_workspace_id' => null]); - $response = $this->actingAs($this->user)->get(route('workspace.settings')); + $response = $this->actingAs($this->user)->get(route('app.workspace.settings')); - $response->assertRedirect(route('workspaces.create')); + $response->assertRedirect(route('app.workspaces.create')); }); // Update settings tests test('update workspace settings requires authentication', function () { - $response = $this->put(route('workspace.settings.update'), [ + $response = $this->put(route('app.workspace.settings.update'), [ 'name' => 'Updated Name', 'timezone' => 'America/New_York', ]); @@ -192,12 +192,12 @@ }); test('update workspace settings updates workspace', function () { - $response = $this->actingAs($this->user)->put(route('workspace.settings.update'), [ + $response = $this->actingAs($this->user)->put(route('app.workspace.settings.update'), [ 'name' => 'Updated Name', 'timezone' => 'America/New_York', ]); - $response->assertRedirect(route('workspace.settings')); + $response->assertRedirect(route('app.workspace.settings')); $this->workspace->refresh(); expect($this->workspace->name)->toBe('Updated Name'); @@ -205,7 +205,7 @@ }); test('update workspace settings validates required fields', function () { - $response = $this->actingAs($this->user)->put(route('workspace.settings.update'), [ + $response = $this->actingAs($this->user)->put(route('app.workspace.settings.update'), [ 'name' => '', 'timezone' => '', ]); @@ -214,7 +214,7 @@ }); test('update workspace settings validates timezone', function () { - $response = $this->actingAs($this->user)->put(route('workspace.settings.update'), [ + $response = $this->actingAs($this->user)->put(route('app.workspace.settings.update'), [ 'name' => 'Valid Name', 'timezone' => 'Invalid/Timezone', ]); @@ -224,7 +224,7 @@ // Destroy tests test('destroy workspace requires authentication', function () { - $response = $this->delete(route('workspaces.destroy', $this->workspace)); + $response = $this->delete(route('app.workspaces.destroy', $this->workspace)); $response->assertRedirect(route('login')); }); @@ -232,14 +232,14 @@ test('destroy workspace deletes the workspace', function () { $workspaceId = $this->workspace->id; - $response = $this->actingAs($this->user)->delete(route('workspaces.destroy', $this->workspace)); + $response = $this->actingAs($this->user)->delete(route('app.workspaces.destroy', $this->workspace)); - $response->assertRedirect(route('workspaces.index')); + $response->assertRedirect(route('app.workspaces.index')); expect(Workspace::find($workspaceId))->toBeNull(); }); test('destroy workspace clears current workspace if deleting current', function () { - $this->actingAs($this->user)->delete(route('workspaces.destroy', $this->workspace)); + $this->actingAs($this->user)->delete(route('app.workspaces.destroy', $this->workspace)); $this->user->refresh(); expect($this->user->current_workspace_id)->toBeNull(); @@ -248,7 +248,7 @@ test('destroy workspace returns 403 for non-owner', function () { $otherUser = User::factory()->create(['setup' => Setup::Completed]); - $response = $this->actingAs($otherUser)->delete(route('workspaces.destroy', $this->workspace)); + $response = $this->actingAs($otherUser)->delete(route('app.workspaces.destroy', $this->workspace)); $response->assertForbidden(); }); diff --git a/tests/Feature/WorkspaceHashtagControllerTest.php b/tests/Feature/WorkspaceHashtagControllerTest.php index 54aca131..3f41a79d 100644 --- a/tests/Feature/WorkspaceHashtagControllerTest.php +++ b/tests/Feature/WorkspaceHashtagControllerTest.php @@ -13,7 +13,7 @@ // Index tests test('hashtags index requires authentication', function () { - $response = $this->get(route('hashtags.index')); + $response = $this->get(route('app.hashtags.index')); $response->assertRedirect(route('login')); }); @@ -21,7 +21,7 @@ test('hashtags index shows hashtags for workspace', function () { WorkspaceHashtag::factory()->count(3)->create(['workspace_id' => $this->workspace->id]); - $response = $this->actingAs($this->user)->get(route('hashtags.index')); + $response = $this->actingAs($this->user)->get(route('app.hashtags.index')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -34,14 +34,14 @@ test('hashtags index redirects if no workspace', function () { $this->user->update(['current_workspace_id' => null]); - $response = $this->actingAs($this->user)->get(route('hashtags.index')); + $response = $this->actingAs($this->user)->get(route('app.hashtags.index')); - $response->assertRedirect(route('workspaces.create')); + $response->assertRedirect(route('app.workspaces.create')); }); // Store tests test('store hashtag requires authentication', function () { - $response = $this->post(route('hashtags.store'), [ + $response = $this->post(route('app.hashtags.store'), [ 'name' => 'Marketing', 'hashtags' => '#marketing #digital #growth', ]); @@ -50,12 +50,12 @@ }); test('store hashtag creates hashtag group', function () { - $response = $this->actingAs($this->user)->post(route('hashtags.store'), [ + $response = $this->actingAs($this->user)->post(route('app.hashtags.store'), [ 'name' => 'Marketing', 'hashtags' => '#marketing #digital #growth', ]); - $response->assertRedirect(route('hashtags.index')); + $response->assertRedirect(route('app.hashtags.index')); $this->assertDatabaseHas('workspace_hashtags', [ 'workspace_id' => $this->workspace->id, @@ -65,7 +65,7 @@ }); test('store hashtag validates required fields', function () { - $response = $this->actingAs($this->user)->post(route('hashtags.store'), [ + $response = $this->actingAs($this->user)->post(route('app.hashtags.store'), [ 'name' => '', 'hashtags' => '', ]); @@ -77,7 +77,7 @@ test('update hashtag requires authentication', function () { $hashtag = WorkspaceHashtag::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->put(route('hashtags.update', $hashtag), [ + $response = $this->put(route('app.hashtags.update', $hashtag), [ 'name' => 'Updated Name', 'hashtags' => '#updated #hashtags', ]); @@ -88,12 +88,12 @@ test('update hashtag updates the hashtag group', function () { $hashtag = WorkspaceHashtag::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->actingAs($this->user)->put(route('hashtags.update', $hashtag), [ + $response = $this->actingAs($this->user)->put(route('app.hashtags.update', $hashtag), [ 'name' => 'Updated Name', 'hashtags' => '#updated #hashtags', ]); - $response->assertRedirect(route('hashtags.index')); + $response->assertRedirect(route('app.hashtags.index')); $hashtag->refresh(); expect($hashtag->name)->toBe('Updated Name'); @@ -104,7 +104,7 @@ $otherWorkspace = Workspace::factory()->create(); $hashtag = WorkspaceHashtag::factory()->create(['workspace_id' => $otherWorkspace->id]); - $response = $this->actingAs($this->user)->put(route('hashtags.update', $hashtag), [ + $response = $this->actingAs($this->user)->put(route('app.hashtags.update', $hashtag), [ 'name' => 'Updated Name', 'hashtags' => '#updated #hashtags', ]); @@ -116,7 +116,7 @@ test('destroy hashtag requires authentication', function () { $hashtag = WorkspaceHashtag::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->delete(route('hashtags.destroy', $hashtag)); + $response = $this->delete(route('app.hashtags.destroy', $hashtag)); $response->assertRedirect(route('login')); }); @@ -124,9 +124,9 @@ test('destroy hashtag deletes the hashtag group', function () { $hashtag = WorkspaceHashtag::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->actingAs($this->user)->delete(route('hashtags.destroy', $hashtag)); + $response = $this->actingAs($this->user)->delete(route('app.hashtags.destroy', $hashtag)); - $response->assertRedirect(route('hashtags.index')); + $response->assertRedirect(route('app.hashtags.index')); expect(WorkspaceHashtag::find($hashtag->id))->toBeNull(); }); @@ -134,7 +134,7 @@ $otherWorkspace = Workspace::factory()->create(); $hashtag = WorkspaceHashtag::factory()->create(['workspace_id' => $otherWorkspace->id]); - $response = $this->actingAs($this->user)->delete(route('hashtags.destroy', $hashtag)); + $response = $this->actingAs($this->user)->delete(route('app.hashtags.destroy', $hashtag)); $response->assertNotFound(); }); diff --git a/tests/Feature/WorkspaceInviteControllerTest.php b/tests/Feature/WorkspaceInviteControllerTest.php index a4197760..f68e71f4 100644 --- a/tests/Feature/WorkspaceInviteControllerTest.php +++ b/tests/Feature/WorkspaceInviteControllerTest.php @@ -17,7 +17,7 @@ // Index tests test('members index requires authentication', function () { - $response = $this->get(route('members')); + $response = $this->get(route('app.members')); $response->assertRedirect(route('login')); }); @@ -27,7 +27,7 @@ 'workspace_id' => $this->workspace->id, ]); - $response = $this->actingAs($this->user)->get(route('members')); + $response = $this->actingAs($this->user)->get(route('app.members')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -43,14 +43,14 @@ test('members index redirects if no workspace', function () { $this->user->update(['current_workspace_id' => null]); - $response = $this->actingAs($this->user)->get(route('members')); + $response = $this->actingAs($this->user)->get(route('app.members')); - $response->assertRedirect(route('workspaces.create')); + $response->assertRedirect(route('app.workspaces.create')); }); // Store invite tests test('store invite requires authentication', function () { - $response = $this->post(route('invites.store'), [ + $response = $this->post(route('app.invites.store'), [ 'email' => 'test@example.com', 'role' => WorkspaceRole::Member->value, ]); @@ -59,7 +59,7 @@ }); test('store invite creates invite and sends email', function () { - $response = $this->actingAs($this->user)->post(route('invites.store'), [ + $response = $this->actingAs($this->user)->post(route('app.invites.store'), [ 'email' => 'newmember@example.com', 'role' => WorkspaceRole::Member->value, ]); @@ -80,7 +80,7 @@ 'email' => 'existing@example.com', ]); - $response = $this->actingAs($this->user)->post(route('invites.store'), [ + $response = $this->actingAs($this->user)->post(route('app.invites.store'), [ 'email' => 'existing@example.com', 'role' => WorkspaceRole::Member->value, ]); @@ -92,7 +92,7 @@ $member = User::factory()->create(['setup' => Setup::Completed]); $this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]); - $response = $this->actingAs($this->user)->post(route('invites.store'), [ + $response = $this->actingAs($this->user)->post(route('app.invites.store'), [ 'email' => $member->email, 'role' => WorkspaceRole::Member->value, ]); @@ -106,7 +106,7 @@ 'workspace_id' => $this->workspace->id, ]); - $response = $this->delete(route('invites.destroy', $invite)); + $response = $this->delete(route('app.invites.destroy', $invite)); $response->assertRedirect(route('login')); }); @@ -116,7 +116,7 @@ 'workspace_id' => $this->workspace->id, ]); - $response = $this->actingAs($this->user)->delete(route('invites.destroy', $invite)); + $response = $this->actingAs($this->user)->delete(route('app.invites.destroy', $invite)); $response->assertRedirect(); expect(WorkspaceInvite::find($invite->id))->toBeNull(); @@ -128,7 +128,7 @@ 'workspace_id' => $otherWorkspace->id, ]); - $response = $this->actingAs($this->user)->delete(route('invites.destroy', $invite)); + $response = $this->actingAs($this->user)->delete(route('app.invites.destroy', $invite)); $response->assertNotFound(); }); @@ -138,7 +138,7 @@ $member = User::factory()->create(['setup' => Setup::Completed]); $this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]); - $response = $this->delete(route('members.remove', $member)); + $response = $this->delete(route('app.members.remove', $member)); $response->assertRedirect(route('login')); }); @@ -147,14 +147,14 @@ $member = User::factory()->create(['setup' => Setup::Completed]); $this->workspace->members()->attach($member->id, ['role' => WorkspaceRole::Member->value]); - $response = $this->actingAs($this->user)->delete(route('members.remove', $member)); + $response = $this->actingAs($this->user)->delete(route('app.members.remove', $member)); $response->assertRedirect(); expect($this->workspace->hasMember($member))->toBeFalse(); }); test('remove member fails for owner', function () { - $response = $this->actingAs($this->user)->delete(route('members.remove', $this->user)); + $response = $this->actingAs($this->user)->delete(route('app.members.remove', $this->user)); $response->assertSessionHasErrors('member'); }); diff --git a/tests/Feature/WorkspaceLabelControllerTest.php b/tests/Feature/WorkspaceLabelControllerTest.php index eb7151c8..3783d2c4 100644 --- a/tests/Feature/WorkspaceLabelControllerTest.php +++ b/tests/Feature/WorkspaceLabelControllerTest.php @@ -13,7 +13,7 @@ // Index tests test('labels index requires authentication', function () { - $response = $this->get(route('labels.index')); + $response = $this->get(route('app.labels.index')); $response->assertRedirect(route('login')); }); @@ -21,7 +21,7 @@ test('labels index shows labels for workspace', function () { WorkspaceLabel::factory()->count(3)->create(['workspace_id' => $this->workspace->id]); - $response = $this->actingAs($this->user)->get(route('labels.index')); + $response = $this->actingAs($this->user)->get(route('app.labels.index')); $response->assertOk(); $response->assertInertia(fn ($page) => $page @@ -34,14 +34,14 @@ test('labels index redirects if no workspace', function () { $this->user->update(['current_workspace_id' => null]); - $response = $this->actingAs($this->user)->get(route('labels.index')); + $response = $this->actingAs($this->user)->get(route('app.labels.index')); - $response->assertRedirect(route('workspaces.create')); + $response->assertRedirect(route('app.workspaces.create')); }); // Store tests test('store label requires authentication', function () { - $response = $this->post(route('labels.store'), [ + $response = $this->post(route('app.labels.store'), [ 'name' => 'Test Label', 'color' => '#FF5733', ]); @@ -50,12 +50,12 @@ }); test('store label creates label', function () { - $response = $this->actingAs($this->user)->post(route('labels.store'), [ + $response = $this->actingAs($this->user)->post(route('app.labels.store'), [ 'name' => 'New Label', 'color' => '#FF5733', ]); - $response->assertRedirect(route('labels.index')); + $response->assertRedirect(route('app.labels.index')); $this->assertDatabaseHas('workspace_labels', [ 'workspace_id' => $this->workspace->id, @@ -65,7 +65,7 @@ }); test('store label validates required fields', function () { - $response = $this->actingAs($this->user)->post(route('labels.store'), [ + $response = $this->actingAs($this->user)->post(route('app.labels.store'), [ 'name' => '', 'color' => '', ]); @@ -74,7 +74,7 @@ }); test('store label validates color format', function () { - $response = $this->actingAs($this->user)->post(route('labels.store'), [ + $response = $this->actingAs($this->user)->post(route('app.labels.store'), [ 'name' => 'Valid Name', 'color' => 'invalid-color', ]); @@ -86,7 +86,7 @@ test('update label requires authentication', function () { $label = WorkspaceLabel::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->put(route('labels.update', $label), [ + $response = $this->put(route('app.labels.update', $label), [ 'name' => 'Updated Label', 'color' => '#00FF00', ]); @@ -97,12 +97,12 @@ test('update label updates the label', function () { $label = WorkspaceLabel::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->actingAs($this->user)->put(route('labels.update', $label), [ + $response = $this->actingAs($this->user)->put(route('app.labels.update', $label), [ 'name' => 'Updated Label', 'color' => '#00FF00', ]); - $response->assertRedirect(route('labels.index')); + $response->assertRedirect(route('app.labels.index')); $label->refresh(); expect($label->name)->toBe('Updated Label'); @@ -113,7 +113,7 @@ $otherWorkspace = Workspace::factory()->create(); $label = WorkspaceLabel::factory()->create(['workspace_id' => $otherWorkspace->id]); - $response = $this->actingAs($this->user)->put(route('labels.update', $label), [ + $response = $this->actingAs($this->user)->put(route('app.labels.update', $label), [ 'name' => 'Updated Label', 'color' => '#00FF00', ]); @@ -125,7 +125,7 @@ test('destroy label requires authentication', function () { $label = WorkspaceLabel::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->delete(route('labels.destroy', $label)); + $response = $this->delete(route('app.labels.destroy', $label)); $response->assertRedirect(route('login')); }); @@ -133,9 +133,9 @@ test('destroy label deletes the label', function () { $label = WorkspaceLabel::factory()->create(['workspace_id' => $this->workspace->id]); - $response = $this->actingAs($this->user)->delete(route('labels.destroy', $label)); + $response = $this->actingAs($this->user)->delete(route('app.labels.destroy', $label)); - $response->assertRedirect(route('labels.index')); + $response->assertRedirect(route('app.labels.index')); expect(WorkspaceLabel::find($label->id))->toBeNull(); }); @@ -143,7 +143,7 @@ $otherWorkspace = Workspace::factory()->create(); $label = WorkspaceLabel::factory()->create(['workspace_id' => $otherWorkspace->id]); - $response = $this->actingAs($this->user)->delete(route('labels.destroy', $label)); + $response = $this->actingAs($this->user)->delete(route('app.labels.destroy', $label)); $response->assertNotFound(); }); diff --git a/tests/Pest.php b/tests/Pest.php index b3a25b73..f2e39978 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -1,5 +1,8 @@ extend(Tests\TestCase::class) - ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) +pest()->extend(TestCase::class) + ->use(RefreshDatabase::class) ->in('Feature', 'Unit'); /* diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 27f3f877..44a4f337 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -2,4 +2,4 @@ test('that true is true', function () { expect(true)->toBeTrue(); -}); \ No newline at end of file +}); diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php index 3c9cb2a4..1c7dc27b 100644 --- a/tests/Unit/HelpersTest.php +++ b/tests/Unit/HelpersTest.php @@ -84,7 +84,7 @@ test('uploadFromUrl handles exceptions gracefully', function () { Http::fake(function () { - throw new \Exception('Network error'); + throw new Exception('Network error'); }); $result = uploadFromUrl('https://example.com/image.jpg'); diff --git a/tests/Unit/Mail/AccountDisconnectedTest.php b/tests/Unit/Mail/AccountDisconnectedTest.php index c62e1977..3e9f6ffa 100644 --- a/tests/Unit/Mail/AccountDisconnectedTest.php +++ b/tests/Unit/Mail/AccountDisconnectedTest.php @@ -4,6 +4,7 @@ use App\Mail\AccountDisconnected; use App\Models\SocialAccount; use App\Models\Workspace; +use Illuminate\Contracts\Queue\ShouldQueue; test('account disconnected mail has correct subject', function () { $workspace = Workspace::factory()->create(['name' => 'My Workspace']); @@ -36,7 +37,7 @@ expect($content->with['platformName'])->toBe('LinkedIn'); expect($content->with['accountName'])->toBe('John Doe'); expect($content->with['workspaceName'])->toBe('Test Team'); - expect($content->with['url'])->toBe(route('accounts')); + expect($content->with['url'])->toBe(route('app.accounts')); }); test('account disconnected mail uses username when display name is null', function () { @@ -64,5 +65,5 @@ $mail = new AccountDisconnected($account); - expect($mail)->toBeInstanceOf(\Illuminate\Contracts\Queue\ShouldQueue::class); + expect($mail)->toBeInstanceOf(ShouldQueue::class); }); diff --git a/tests/Unit/Mail/WorkspaceInviteTest.php b/tests/Unit/Mail/WorkspaceInviteTest.php index d0b5492c..7a903329 100644 --- a/tests/Unit/Mail/WorkspaceInviteTest.php +++ b/tests/Unit/Mail/WorkspaceInviteTest.php @@ -3,6 +3,7 @@ use App\Mail\WorkspaceInvite; use App\Models\Workspace; use App\Models\WorkspaceInvite as WorkspaceInviteModel; +use Illuminate\Contracts\Queue\ShouldQueue; test('workspace invite mail has correct subject', function () { $workspace = Workspace::factory()->create(['name' => 'Test Workspace']); @@ -28,7 +29,7 @@ expect($content->with['title'])->toBe("You've been invited to join My Team"); expect($content->with['previewText'])->toBe("You've been invited to join My Team"); expect($content->with['invite'])->toBe($invite); - expect($content->with['url'])->toBe(route('invites.show', $invite->id)); + expect($content->with['url'])->toBe(route('app.invites.show', $invite->id)); }); test('workspace invite mail has no attachments', function () { @@ -44,5 +45,5 @@ $mail = new WorkspaceInvite($invite); - expect($mail)->toBeInstanceOf(\Illuminate\Contracts\Queue\ShouldQueue::class); + expect($mail)->toBeInstanceOf(ShouldQueue::class); }); diff --git a/tests/Unit/Models/MediaTest.php b/tests/Unit/Models/MediaTest.php index 85a513ee..e33f834a 100644 --- a/tests/Unit/Models/MediaTest.php +++ b/tests/Unit/Models/MediaTest.php @@ -1,7 +1,6 @@ $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'Instagram requires at least one image or video.'); + ->toThrow(Exception::class, 'Instagram requires at least one image or video.'); }); test('instagram publisher publishes single image', function () { @@ -142,5 +142,5 @@ $publisher = new InstagramPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class); + ->toThrow(Exception::class); }); diff --git a/tests/Unit/Services/LinkedInPublisherTest.php b/tests/Unit/Services/LinkedInPublisherTest.php index 349a161a..43b3820b 100644 --- a/tests/Unit/Services/LinkedInPublisherTest.php +++ b/tests/Unit/Services/LinkedInPublisherTest.php @@ -9,7 +9,6 @@ use App\Models\Workspace; use App\Services\Social\LinkedInPublisher; use Illuminate\Support\Facades\Http; -use Illuminate\Support\Facades\Storage; beforeEach(function () { $this->workspace = Workspace::factory()->create(); @@ -47,7 +46,7 @@ $publisher = new LinkedInPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'No valid images for LinkedIn carousel'); + ->toThrow(Exception::class, 'No valid images for LinkedIn carousel'); }); test('linkedin publisher throws token expired exception on oauth error', function () { @@ -138,7 +137,7 @@ $publisher = new LinkedInPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class); + ->toThrow(Exception::class); }); test('linkedin publisher throws exception for unsupported content type', function () { @@ -147,7 +146,7 @@ $publisher = new LinkedInPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'Unsupported LinkedIn content type'); + ->toThrow(Exception::class, 'Unsupported LinkedIn content type'); }); test('linkedin publisher handles 401 status as token error', function () { @@ -179,7 +178,7 @@ $publisher = new LinkedInPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class); + ->toThrow(Exception::class); }); test('linkedin publisher refreshes token when expiring soon', function () { diff --git a/tests/Unit/Services/Social/FacebookPublisherTest.php b/tests/Unit/Services/Social/FacebookPublisherTest.php index 8c567b1b..b8786fcd 100644 --- a/tests/Unit/Services/Social/FacebookPublisherTest.php +++ b/tests/Unit/Services/Social/FacebookPublisherTest.php @@ -332,7 +332,7 @@ $this->postPlatform->update(['content' => null]); expect(fn () => $this->publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'Facebook text posts require content'); + ->toThrow(Exception::class, 'Facebook text posts require content'); }); test('facebook publisher can publish single image with null content', function () { diff --git a/tests/Unit/Services/Social/InstagramPublisherTest.php b/tests/Unit/Services/Social/InstagramPublisherTest.php index aa93d95d..76cc38a2 100644 --- a/tests/Unit/Services/Social/InstagramPublisherTest.php +++ b/tests/Unit/Services/Social/InstagramPublisherTest.php @@ -40,7 +40,7 @@ test('instagram publisher throws exception without media', function () { expect(fn () => $this->publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'Instagram requires at least one image or video'); + ->toThrow(Exception::class, 'Instagram requires at least one image or video'); }); test('instagram publisher can publish single image', function () { diff --git a/tests/Unit/Services/Social/LinkedInTokenSynchronizerTest.php b/tests/Unit/Services/Social/LinkedInTokenSynchronizerTest.php index cf8b43dd..6d5ba301 100644 --- a/tests/Unit/Services/Social/LinkedInTokenSynchronizerTest.php +++ b/tests/Unit/Services/Social/LinkedInTokenSynchronizerTest.php @@ -1,6 +1,5 @@ postPlatform->update(['content' => null]); expect(fn () => $this->publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'Threads text posts require content'); + ->toThrow(Exception::class, 'Threads text posts require content'); }); test('threads publisher can publish image with null content', function () { diff --git a/tests/Unit/Services/Social/XPublisherTest.php b/tests/Unit/Services/Social/XPublisherTest.php index 19d39b7c..31dc06a4 100644 --- a/tests/Unit/Services/Social/XPublisherTest.php +++ b/tests/Unit/Services/Social/XPublisherTest.php @@ -160,14 +160,14 @@ $this->postPlatform->update(['content' => '']); expect(fn () => $this->publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'X posts require either text or media'); + ->toThrow(Exception::class, 'X posts require either text or media'); }); test('x publisher throws exception with null content and no media', function () { $this->postPlatform->update(['content' => null]); expect(fn () => $this->publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'X posts require either text or media'); + ->toThrow(Exception::class, 'X posts require either text or media'); }); test('x publisher throws exception when no refresh token available', function () { diff --git a/tests/Unit/Services/Social/YouTubePublisherTest.php b/tests/Unit/Services/Social/YouTubePublisherTest.php index 00aca658..65a61fed 100644 --- a/tests/Unit/Services/Social/YouTubePublisherTest.php +++ b/tests/Unit/Services/Social/YouTubePublisherTest.php @@ -86,7 +86,7 @@ try { $this->publisher->publish($this->postPlatform); - } catch (\Exception $e) { + } catch (Exception $e) { // Expected to fail on upload, but token should be refreshed } @@ -159,5 +159,5 @@ ]); expect(fn () => $this->publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'YouTube Shorts require a title'); + ->toThrow(Exception::class, 'YouTube Shorts require a title'); }); diff --git a/tests/Unit/Services/XPublisherTest.php b/tests/Unit/Services/XPublisherTest.php index dea9c474..b19ae6a4 100644 --- a/tests/Unit/Services/XPublisherTest.php +++ b/tests/Unit/Services/XPublisherTest.php @@ -105,7 +105,7 @@ $publisher = new XPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class); + ->toThrow(Exception::class); }); test('x publisher returns unknown id when no id in response', function () { @@ -177,7 +177,7 @@ $publisher = new XPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'X API error'); + ->toThrow(Exception::class, 'X API error'); }); test('x publisher handles empty error response', function () { @@ -188,5 +188,5 @@ $publisher = new XPublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class); + ->toThrow(Exception::class); }); diff --git a/tests/Unit/Services/YouTubePublisherTest.php b/tests/Unit/Services/YouTubePublisherTest.php index 457fac19..25ff8a4b 100644 --- a/tests/Unit/Services/YouTubePublisherTest.php +++ b/tests/Unit/Services/YouTubePublisherTest.php @@ -33,7 +33,7 @@ $publisher = new YouTubePublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'YouTube Shorts requires a video to publish.'); + ->toThrow(Exception::class, 'YouTube Shorts requires a video to publish.'); }); test('youtube publisher throws exception for non video media', function () { @@ -46,7 +46,7 @@ $publisher = new YouTubePublisher; expect(fn () => $publisher->publish($this->postPlatform)) - ->toThrow(\Exception::class, 'YouTube Shorts only supports video content.'); + ->toThrow(Exception::class, 'YouTube Shorts only supports video content.'); }); test('youtube publisher throws exception when no refresh token for expired token', function () { diff --git a/tests/Unit/Traits/HasMediaTest.php b/tests/Unit/Traits/HasMediaTest.php index 1a7b07cd..186991fd 100644 --- a/tests/Unit/Traits/HasMediaTest.php +++ b/tests/Unit/Traits/HasMediaTest.php @@ -4,6 +4,7 @@ use App\Models\PostPlatform; use App\Models\User; use App\Models\Workspace; +use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; @@ -14,7 +15,7 @@ test('model can get media relationship', function () { $workspace = Workspace::factory()->create(); - expect($workspace->media())->toBeInstanceOf(\Illuminate\Database\Eloquent\Relations\MorphMany::class); + expect($workspace->media())->toBeInstanceOf(MorphMany::class); }); test('model can add media from uploaded file', function () { From 6964cc8e6ec1149ddb11bd5974303fc8f23522da Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sun, 29 Mar 2026 19:43:15 -0300 Subject: [PATCH 02/91] fix: update frontend route/action imports for new subdomain structure Update all Vue components and TypeScript files to import from the new Wayfinder-generated paths under @/routes/app/ and @/actions/App/Http/Controllers/App/. --- lang/php_en.json | 1 - lang/php_pt-br.json | 1 - resources/js/components/AppHeader.vue | 2 +- resources/js/components/AppSidebar.vue | 19 ++++++++++--------- resources/js/components/DeleteUser.vue | 2 +- resources/js/components/PhotoUpload.vue | 2 +- resources/js/components/UserMenuContent.vue | 2 +- resources/js/components/WorkspaceSwitcher.vue | 2 +- .../js/components/hashtags/CreateDialog.vue | 2 +- .../js/components/hashtags/EditDialog.vue | 2 +- .../js/components/labels/CreateDialog.vue | 2 +- resources/js/components/labels/EditDialog.vue | 2 +- resources/js/composables/useMediaManager.ts | 2 +- resources/js/layouts/OnboardingLayout.vue | 2 +- resources/js/layouts/auth/AuthCardLayout.vue | 2 +- .../js/layouts/auth/AuthSimpleLayout.vue | 2 +- resources/js/layouts/settings/Layout.vue | 10 +++++----- .../js/pages/accounts/BlueskyConnect.vue | 2 +- .../js/pages/accounts/FacebookPageSelect.vue | 2 +- resources/js/pages/accounts/Index.vue | 4 ++-- .../js/pages/accounts/LinkedInPageSelect.vue | 2 +- .../js/pages/accounts/MastodonConnect.vue | 2 +- resources/js/pages/auth/AcceptInvite.vue | 2 +- resources/js/pages/billing/Index.vue | 2 +- resources/js/pages/billing/Processing.vue | 4 ++-- resources/js/pages/billing/Subscribe.vue | 2 +- resources/js/pages/hashtags/Index.vue | 2 +- resources/js/pages/labels/Index.vue | 2 +- resources/js/pages/onboarding/Step1.vue | 2 +- resources/js/pages/onboarding/Step2.vue | 2 +- resources/js/pages/posts/Calendar.vue | 4 ++-- resources/js/pages/posts/Edit.vue | 2 +- resources/js/pages/posts/Index.vue | 2 +- resources/js/pages/settings/Members.vue | 6 +++--- resources/js/pages/settings/Password.vue | 4 ++-- resources/js/pages/settings/Profile.vue | 4 ++-- resources/js/pages/settings/Workspace.vue | 4 ++-- resources/js/pages/workspaces/Index.vue | 6 +++--- resources/js/pages/workspaces/Show.vue | 4 ++-- 39 files changed, 61 insertions(+), 62 deletions(-) delete mode 100644 lang/php_en.json delete mode 100644 lang/php_pt-br.json diff --git a/lang/php_en.json b/lang/php_en.json deleted file mode 100644 index 156232fe..00000000 --- a/lang/php_en.json +++ /dev/null @@ -1 +0,0 @@ -{"auth.failed":"These credentials do not match our records.","auth.password":"The provided password is incorrect.","auth.throttle":"Too many login attempts. Please try again in :seconds seconds.","pagination.previous":"« Previous","pagination.next":"Next »","passwords.reset":"Your password has been reset.","passwords.sent":"We have emailed your password reset link.","passwords.throttled":"Please wait before retrying.","passwords.token":"This password reset token is invalid.","passwords.user":"We can't find a user with that email address.","validation.accepted":"The :attribute field must be accepted.","validation.accepted_if":"The :attribute field must be accepted when :other is :value.","validation.active_url":"The :attribute field must be a valid URL.","validation.after":"The :attribute field must be a date after :date.","validation.after_or_equal":"The :attribute field must be a date after or equal to :date.","validation.alpha":"The :attribute field must only contain letters.","validation.alpha_dash":"The :attribute field must only contain letters, numbers, dashes, and underscores.","validation.alpha_num":"The :attribute field must only contain letters and numbers.","validation.any_of":"The :attribute field is invalid.","validation.array":"The :attribute field must be an array.","validation.ascii":"The :attribute field must only contain single-byte alphanumeric characters and symbols.","validation.before":"The :attribute field must be a date before :date.","validation.before_or_equal":"The :attribute field must be a date before or equal to :date.","validation.between.array":"The :attribute field must have between :min and :max items.","validation.between.file":"The :attribute field must be between :min and :max kilobytes.","validation.between.numeric":"The :attribute field must be between :min and :max.","validation.between.string":"The :attribute field must be between :min and :max characters.","validation.boolean":"The :attribute field must be true or false.","validation.can":"The :attribute field contains an unauthorized value.","validation.confirmed":"The :attribute field confirmation does not match.","validation.contains":"The :attribute field is missing a required value.","validation.current_password":"The password is incorrect.","validation.date":"The :attribute field must be a valid date.","validation.date_equals":"The :attribute field must be a date equal to :date.","validation.date_format":"The :attribute field must match the format :format.","validation.decimal":"The :attribute field must have :decimal decimal places.","validation.declined":"The :attribute field must be declined.","validation.declined_if":"The :attribute field must be declined when :other is :value.","validation.different":"The :attribute field and :other must be different.","validation.digits":"The :attribute field must be :digits digits.","validation.digits_between":"The :attribute field must be between :min and :max digits.","validation.dimensions":"The :attribute field has invalid image dimensions.","validation.distinct":"The :attribute field has a duplicate value.","validation.doesnt_contain":"The :attribute field must not contain any of the following: :values.","validation.doesnt_end_with":"The :attribute field must not end with one of the following: :values.","validation.doesnt_start_with":"The :attribute field must not start with one of the following: :values.","validation.email":"The :attribute field must be a valid email address.","validation.encoding":"The :attribute field must be encoded in :encoding.","validation.ends_with":"The :attribute field must end with one of the following: :values.","validation.enum":"The selected :attribute is invalid.","validation.exists":"The selected :attribute is invalid.","validation.extensions":"The :attribute field must have one of the following extensions: :values.","validation.file":"The :attribute field must be a file.","validation.filled":"The :attribute field must have a value.","validation.gt.array":"The :attribute field must have more than :value items.","validation.gt.file":"The :attribute field must be greater than :value kilobytes.","validation.gt.numeric":"The :attribute field must be greater than :value.","validation.gt.string":"The :attribute field must be greater than :value characters.","validation.gte.array":"The :attribute field must have :value items or more.","validation.gte.file":"The :attribute field must be greater than or equal to :value kilobytes.","validation.gte.numeric":"The :attribute field must be greater than or equal to :value.","validation.gte.string":"The :attribute field must be greater than or equal to :value characters.","validation.hex_color":"The :attribute field must be a valid hexadecimal color.","validation.image":"The :attribute field must be an image.","validation.in":"The selected :attribute is invalid.","validation.in_array":"The :attribute field must exist in :other.","validation.in_array_keys":"The :attribute field must contain at least one of the following keys: :values.","validation.integer":"The :attribute field must be an integer.","validation.ip":"The :attribute field must be a valid IP address.","validation.ipv4":"The :attribute field must be a valid IPv4 address.","validation.ipv6":"The :attribute field must be a valid IPv6 address.","validation.json":"The :attribute field must be a valid JSON string.","validation.list":"The :attribute field must be a list.","validation.lowercase":"The :attribute field must be lowercase.","validation.lt.array":"The :attribute field must have less than :value items.","validation.lt.file":"The :attribute field must be less than :value kilobytes.","validation.lt.numeric":"The :attribute field must be less than :value.","validation.lt.string":"The :attribute field must be less than :value characters.","validation.lte.array":"The :attribute field must not have more than :value items.","validation.lte.file":"The :attribute field must be less than or equal to :value kilobytes.","validation.lte.numeric":"The :attribute field must be less than or equal to :value.","validation.lte.string":"The :attribute field must be less than or equal to :value characters.","validation.mac_address":"The :attribute field must be a valid MAC address.","validation.max.array":"The :attribute field must not have more than :max items.","validation.max.file":"The :attribute field must not be greater than :max kilobytes.","validation.max.numeric":"The :attribute field must not be greater than :max.","validation.max.string":"The :attribute field must not be greater than :max characters.","validation.max_digits":"The :attribute field must not have more than :max digits.","validation.mimes":"The :attribute field must be a file of type: :values.","validation.mimetypes":"The :attribute field must be a file of type: :values.","validation.min.array":"The :attribute field must have at least :min items.","validation.min.file":"The :attribute field must be at least :min kilobytes.","validation.min.numeric":"The :attribute field must be at least :min.","validation.min.string":"The :attribute field must be at least :min characters.","validation.min_digits":"The :attribute field must have at least :min digits.","validation.missing":"The :attribute field must be missing.","validation.missing_if":"The :attribute field must be missing when :other is :value.","validation.missing_unless":"The :attribute field must be missing unless :other is :value.","validation.missing_with":"The :attribute field must be missing when :values is present.","validation.missing_with_all":"The :attribute field must be missing when :values are present.","validation.multiple_of":"The :attribute field must be a multiple of :value.","validation.not_in":"The selected :attribute is invalid.","validation.not_regex":"The :attribute field format is invalid.","validation.numeric":"The :attribute field must be a number.","validation.password.letters":"The :attribute field must contain at least one letter.","validation.password.mixed":"The :attribute field must contain at least one uppercase and one lowercase letter.","validation.password.numbers":"The :attribute field must contain at least one number.","validation.password.symbols":"The :attribute field must contain at least one symbol.","validation.password.uncompromised":"The given :attribute has appeared in a data leak. Please choose a different :attribute.","validation.present":"The :attribute field must be present.","validation.present_if":"The :attribute field must be present when :other is :value.","validation.present_unless":"The :attribute field must be present unless :other is :value.","validation.present_with":"The :attribute field must be present when :values is present.","validation.present_with_all":"The :attribute field must be present when :values are present.","validation.prohibited":"The :attribute field is prohibited.","validation.prohibited_if":"The :attribute field is prohibited when :other is :value.","validation.prohibited_if_accepted":"The :attribute field is prohibited when :other is accepted.","validation.prohibited_if_declined":"The :attribute field is prohibited when :other is declined.","validation.prohibited_unless":"The :attribute field is prohibited unless :other is in :values.","validation.prohibits":"The :attribute field prohibits :other from being present.","validation.regex":"The :attribute field format is invalid.","validation.required":"The :attribute field is required.","validation.required_array_keys":"The :attribute field must contain entries for: :values.","validation.required_if":"The :attribute field is required when :other is :value.","validation.required_if_accepted":"The :attribute field is required when :other is accepted.","validation.required_if_declined":"The :attribute field is required when :other is declined.","validation.required_unless":"The :attribute field is required unless :other is in :values.","validation.required_with":"The :attribute field is required when :values is present.","validation.required_with_all":"The :attribute field is required when :values are present.","validation.required_without":"The :attribute field is required when :values is not present.","validation.required_without_all":"The :attribute field is required when none of :values are present.","validation.same":"The :attribute field must match :other.","validation.size.array":"The :attribute field must contain :size items.","validation.size.file":"The :attribute field must be :size kilobytes.","validation.size.numeric":"The :attribute field must be :size.","validation.size.string":"The :attribute field must be :size characters.","validation.starts_with":"The :attribute field must start with one of the following: :values.","validation.string":"The :attribute field must be a string.","validation.timezone":"The :attribute field must be a valid timezone.","validation.unique":"The :attribute has already been taken.","validation.uploaded":"The :attribute failed to upload.","validation.uppercase":"The :attribute field must be uppercase.","validation.url":"The :attribute field must be a valid URL.","validation.ulid":"The :attribute field must be a valid ULID.","validation.uuid":"The :attribute field must be a valid UUID.","validation.custom.attribute-name.rule-name":"custom-message","accounts.title":"Connections","accounts.page_title":"Connected Accounts","accounts.description":"Connect your social networks to schedule and publish posts","accounts.not_connected":"Not connected","accounts.connect":"Connect","accounts.connection_lost":"Connection lost","accounts.reconnect_account":"Reconnect account","accounts.view_profile":"View profile","accounts.disconnect":"Disconnect","accounts.disconnect_modal.title":"Disconnect Account","accounts.disconnect_modal.description":"Are you sure you want to disconnect this account? You can reconnect it at any time.","accounts.disconnect_modal.confirm":"Disconnect","accounts.disconnect_modal.cancel":"Cancel","accounts.bluesky.title":"Connect Bluesky","accounts.bluesky.description":"Enter your credentials to connect","accounts.bluesky.email":"Email","accounts.bluesky.email_placeholder":"yourhandle.bsky.social","accounts.bluesky.app_password":"App Password","accounts.bluesky.app_password_placeholder":"xxxx-xxxx-xxxx-xxxx","accounts.bluesky.app_password_hint":"Use an App Password for security. Create one at bsky.app/settings.","accounts.bluesky.submit":"Connect Bluesky","accounts.bluesky.submitting":"Connecting...","accounts.mastodon.title":"Connect Mastodon","accounts.mastodon.description":"Enter your Mastodon instance","accounts.mastodon.instance_url":"Instance URL","accounts.mastodon.instance_placeholder":"https://mastodon.social","accounts.mastodon.instance_hint":"Enter your Mastodon instance URL (e.g., mastodon.social, techhub.social)","accounts.mastodon.submit":"Continue with Mastodon","accounts.mastodon.submitting":"Connecting...","accounts.facebook.title":"Select Facebook Page","accounts.facebook.description":"Choose which page you want to connect","accounts.facebook.no_pages":"No pages found","accounts.facebook.no_pages_description":"You are not an admin of any Facebook page.","accounts.facebook.page_label":"Facebook Page","accounts.linkedin.title":"Select LinkedIn Page","accounts.linkedin.description":"Choose which page you want to connect","accounts.linkedin.no_pages":"No pages found","accounts.linkedin.no_pages_description":"You are not an administrator of any LinkedIn page.","accounts.linkedin.page_label":"LinkedIn Page","accounts.flash.disconnected":"Account disconnected successfully!","accounts.flash.connected":"Account connected successfully!","accounts.flash.session_expired":"Session expired. Please try again.","accounts.flash.workspace_not_found":"Workspace not found.","accounts.flash.already_connected":"This platform is already connected.","accounts.flash.no_youtube_channels":"No YouTube channels found. Please create a channel first.","auth.flash.welcome":"Welcome to TryPost!","auth.flash.welcome_trial":"Welcome to TryPost! Your trial has started.","auth.login.title":"Log in to your account","auth.login.description":"Enter your email and password below to log in","auth.login.page_title":"Log in","auth.login.email":"Email address","auth.login.password":"Password","auth.login.forgot_password":"Forgot password?","auth.login.remember_me":"Remember me","auth.login.submit":"Log in","auth.login.no_account":"Don't have an account?","auth.login.sign_up":"Sign up","auth.register.title":"Create an account","auth.register.description":"Enter your details below to create your account","auth.register.page_title":"Register","auth.register.name":"Name","auth.register.name_placeholder":"Full name","auth.register.email":"Email address","auth.register.password":"Password","auth.register.submit":"Create account","auth.register.has_account":"Already have an account?","auth.register.log_in":"Log in","auth.forgot_password.title":"Forgot password","auth.forgot_password.description":"Enter your email to receive a password reset link","auth.forgot_password.page_title":"Forgot password","auth.forgot_password.email":"Email address","auth.forgot_password.submit":"Email password reset link","auth.forgot_password.return_to":"Or, return to","auth.forgot_password.log_in":"log in","auth.reset_password.title":"Reset password","auth.reset_password.description":"Please enter your new password below","auth.reset_password.page_title":"Reset password","auth.reset_password.email":"Email","auth.reset_password.password":"Password","auth.reset_password.confirm_password":"Confirm Password","auth.reset_password.confirm_placeholder":"Confirm password","auth.reset_password.submit":"Reset password","auth.verify_email.title":"Verify email","auth.verify_email.description":"Please verify your email address by clicking on the link we just emailed to you.","auth.verify_email.page_title":"Email verification","auth.verify_email.link_sent":"A new verification link has been sent to the email address you provided during registration.","auth.verify_email.resend":"Resend verification email","auth.verify_email.log_out":"Log out","auth.accept_invite.page_title":"Accept Invite","auth.accept_invite.title":"You've been invited!","auth.accept_invite.description":"You've been invited to join the :workspace workspace.","auth.accept_invite.workspace":"Workspace","auth.accept_invite.your_role":"Your role","auth.accept_invite.email":"Email","auth.accept_invite.accept":"Accept Invite","auth.accept_invite.decline":"Decline Invite","auth.accept_invite.login_prompt":"Log in or create an account to accept this invite.","auth.accept_invite.log_in":"Log in","auth.accept_invite.create_account":"Create Account","billing.title":"Subscription","billing.description":"Manage your subscription and payment method","billing.trial.title":"Trial period active","billing.trial.description":"Your trial ends on :date. After that, your subscription will be charged automatically.","billing.subscription.title":"Your Subscription","billing.subscription.workspaces":"Workspaces","billing.subscription.quantity":"Subscription quantity","billing.subscription.expires":"Expires :date","billing.subscription.canceled_on":"Your subscription will be canceled on :date","billing.subscription.manage":"Manage on Stripe","billing.invoices.title":"Invoices","billing.invoices.description":"Payment history","billing.invoices.empty":"No invoices found","billing.invoices.paid":"Paid","billing.status.active":"Active","billing.status.canceled":"Canceled","billing.status.incomplete":"Incomplete","billing.status.incomplete_expired":"Expired","billing.status.past_due":"Past due","billing.status.trialing":"Trial","billing.status.unpaid":"Unpaid","calendar.title":"Calendar","calendar.today":"Today","calendar.day":"Day","calendar.week":"Week","calendar.month":"Month","calendar.new_post":"New Post","calendar.no_content":"No content","calendar.more":"+:count more","hashtags.title":"Hashtags","hashtags.description":"Create hashtag groups to quickly add to your posts","hashtags.new_group":"New Group","hashtags.no_groups_yet":"No hashtag groups yet","hashtags.no_groups_description":"Create hashtag groups to quickly add popular hashtags to your posts","hashtags.create_first_group":"Create your first group","hashtags.hashtags_count":":count hashtags","hashtags.create.title":"Create Hashtag Group","hashtags.create.description":"Give your group a name and add hashtags separated by spaces or commas","hashtags.create.name":"Group Name","hashtags.create.name_placeholder":"e.g. Marketing, Travel, Food","hashtags.create.hashtags":"Hashtags","hashtags.create.hashtags_placeholder":"#marketing #socialmedia #business #growth","hashtags.create.hashtags_hint":"Enter hashtags separated by spaces or commas. Include the # symbol.","hashtags.create.submit":"Create Group","hashtags.create.submitting":"Creating...","hashtags.edit.title":"Edit Hashtag Group","hashtags.edit.description":"Update the name and hashtags for this group","hashtags.edit.name":"Group Name","hashtags.edit.name_placeholder":"e.g. Marketing, Travel, Food","hashtags.edit.hashtags":"Hashtags","hashtags.edit.hashtags_placeholder":"#marketing #socialmedia #business #growth","hashtags.edit.hashtags_hint":"Enter hashtags separated by spaces or commas. Include the # symbol.","hashtags.edit.submit":"Save Changes","hashtags.edit.submitting":"Saving...","hashtags.delete.title":"Delete Hashtag Group","hashtags.delete.description":"Are you sure you want to delete this hashtag group? This action cannot be undone.","hashtags.delete.confirm":"Delete","hashtags.delete.cancel":"Cancel","hashtags.flash.created":"Hashtag group created successfully!","hashtags.flash.updated":"Hashtag group updated successfully!","hashtags.flash.deleted":"Hashtag group deleted successfully!","labels.title":"Labels","labels.description":"Create labels to organize and categorize your posts","labels.new_label":"New Label","labels.no_labels_yet":"No labels yet","labels.create_first_label":"Create your first label","labels.create.title":"Create Label","labels.create.description":"Give your label a name and pick a color","labels.create.name":"Name","labels.create.name_placeholder":"Enter label name...","labels.create.color":"Color","labels.create.submit":"Create Label","labels.create.submitting":"Creating...","labels.edit.title":"Edit Label","labels.edit.description":"Update the name and color for this label","labels.edit.name":"Name","labels.edit.name_placeholder":"Enter label name...","labels.edit.color":"Color","labels.edit.submit":"Save Changes","labels.edit.submitting":"Saving...","labels.delete.title":"Delete Label","labels.delete.description":"Are you sure you want to delete this label? This action cannot be undone.","labels.delete.confirm":"Delete","labels.delete.cancel":"Cancel","labels.flash.created":"Label created successfully!","labels.flash.updated":"Label updated successfully!","labels.flash.deleted":"Label deleted successfully!","mail.workspace_connections_disconnected.subject":"{1} :count account needs to be reconnected in :workspace|[2,*] :count accounts need to be reconnected in :workspace","mail.workspace_connections_disconnected.title":"Accounts Need Reconnection","mail.workspace_connections_disconnected.intro":"The following social accounts in your :workspace workspace have been disconnected and need to be reconnected:","mail.workspace_connections_disconnected.reasons_title":"This may have happened because:","mail.workspace_connections_disconnected.reason_expired":"Access tokens expired","mail.workspace_connections_disconnected.reason_revoked":"You revoked access to TryPost on the platform","mail.workspace_connections_disconnected.reason_changed":"The platform changed their authentication requirements","mail.workspace_connections_disconnected.reconnect_cta":"Please reconnect these accounts to continue scheduling and publishing posts.","mail.workspace_connections_disconnected.button":"Reconnect Accounts","posts.title":"Posts","posts.all_posts":"All Posts","posts.new_post":"New Post","posts.no_posts":"No posts found","posts.start_creating":"Start by creating your first post.","posts.manage_posts":"Manage all your posts","posts.delete_confirm":"Are you sure you want to delete this post?","posts.by":"by","posts.actions.view":"View post","posts.actions.delete":"Delete post","posts.form.post_type":"Post Type","posts.form.board":"Board","posts.form.select_board":"Select a board","posts.form.search_board":"Search board...","posts.form.no_board_found":"No board found","posts.form.media":"Media","posts.form.min":"Min","posts.form.uploading":"Uploading...","posts.form.drop_to_upload":"Drop to upload","posts.form.drag_and_drop":"Drag & drop or click to upload","posts.form.photos_and_videos":"Photos and videos","posts.form.photos_only":"Photos only","posts.form.videos_only":"Videos only","posts.form.drag_to_reorder":"Drag to reorder","posts.form.caption":"Caption","posts.form.write_caption":"Write your caption...","posts.status.draft":"Draft","posts.status.scheduled":"Scheduled","posts.status.publishing":"Publishing","posts.status.published":"Published","posts.status.partially_published":"Partially Published","posts.status.failed":"Failed","posts.descriptions.draft":"Posts waiting to be scheduled","posts.descriptions.scheduled":"Posts scheduled for publishing","posts.descriptions.published":"Posts already published","posts.edit.title":"Edit Post","posts.edit.view_title":"View Post","posts.edit.manage_platforms":"Manage platforms","posts.edit.sync":"Sync","posts.edit.labels":"Labels","posts.edit.hashtags":"Hashtags","posts.edit.schedule":"Schedule","posts.edit.publish":"Publish","posts.edit.delete":"Delete","posts.edit.settings":"Settings","posts.edit.schedule_for":"Schedule for","posts.edit.saving":"Saving...","posts.edit.saved":"Saved","posts.edit.scheduled_at":"Scheduled:","posts.edit.published_at":"Published:","posts.edit.media":"Media","posts.edit.caption":"Caption","posts.edit.no_caption":"No caption","posts.edit.no_content":"No content","posts.edit.empty_state.title":"No platforms selected","posts.edit.empty_state.description":"Select at least one platform to create your post","posts.edit.delete_modal.title":"Delete Post","posts.edit.delete_modal.description":"Are you sure you want to delete this post? This action cannot be undone.","posts.edit.delete_modal.action":"Delete","posts.edit.delete_modal.cancel":"Cancel","posts.edit.sync_enable.title":"Enable sync?","posts.edit.sync_enable.description":"All platforms will share the same content. Any custom edits made to individual platforms will be replaced with the current content.","posts.edit.sync_enable.cancel":"Cancel","posts.edit.sync_enable.action":"Enable sync","posts.edit.sync_disable.title":"Disable sync?","posts.edit.sync_disable.description":"Each platform will keep its current content, but future edits will only apply to the platform you're editing.","posts.edit.sync_disable.customize_note":"You'll be able to customize the content for each platform individually.","posts.edit.sync_disable.cancel":"Cancel","posts.edit.sync_disable.action":"Disable sync","posts.edit.platforms_dialog.title":"Select Platforms","posts.edit.platforms_dialog.description":"Choose which platforms to publish this post to.","posts.edit.hashtags_modal.search":"Search hashtags...","posts.edit.hashtags_modal.no_results":"No hashtags found.","posts.edit.validation.select_board":"Select a board","posts.edit.validation.images_not_supported":"Images not supported","posts.edit.validation.videos_not_supported":"Videos not supported","posts.edit.validation.max_images":"Max :count images","posts.edit.validation.requires_media":"Requires media","posts.edit.validation.exceeded":":count exceeded","posts.edit.validation.does_not_support_images":":platform does not support images","posts.edit.validation.supports_up_to_images":":platform supports up to :count images","posts.edit.validation.does_not_support_videos":":platform does not support videos","posts.content_types.instagram_feed.label":"Feed Post","posts.content_types.instagram_feed.description":"Appears in your feed and profile","posts.content_types.instagram_reel.label":"Reel","posts.content_types.instagram_reel.description":"Short video up to 90 seconds","posts.content_types.instagram_story.label":"Story","posts.content_types.instagram_story.description":"Disappears after 24 hours","posts.content_types.linkedin_post.label":"Post","posts.content_types.linkedin_post.description":"Standard post with text and media","posts.content_types.linkedin_carousel.label":"Carousel","posts.content_types.linkedin_carousel.description":"Swipeable images","posts.content_types.linkedin_page_post.label":"Post","posts.content_types.linkedin_page_post.description":"Standard post with text and media","posts.content_types.linkedin_page_carousel.label":"Carousel","posts.content_types.linkedin_page_carousel.description":"Swipeable images","posts.content_types.facebook_post.label":"Post","posts.content_types.facebook_post.description":"Standard post on your page","posts.content_types.facebook_reel.label":"Reel","posts.content_types.facebook_reel.description":"Short video up to 90 seconds","posts.content_types.facebook_story.label":"Story","posts.content_types.facebook_story.description":"Disappears after 24 hours","posts.content_types.tiktok_video.label":"Video","posts.content_types.tiktok_video.description":"Short-form video content","posts.content_types.youtube_short.label":"Short","posts.content_types.youtube_short.description":"Vertical video up to 60 seconds","posts.content_types.x_post.label":"Post","posts.content_types.x_post.description":"Tweet with text and media","posts.content_types.threads_post.label":"Post","posts.content_types.threads_post.description":"Text post with optional media","posts.content_types.pinterest_pin.label":"Pin","posts.content_types.pinterest_pin.description":"Image pin with link","posts.content_types.pinterest_video_pin.label":"Video Pin","posts.content_types.pinterest_video_pin.description":"Video content","posts.content_types.pinterest_carousel.label":"Carousel","posts.content_types.pinterest_carousel.description":"2-5 images","posts.content_types.bluesky_post.label":"Post","posts.content_types.bluesky_post.description":"Text post with optional images","posts.content_types.mastodon_post.label":"Post","posts.content_types.mastodon_post.description":"Text post with optional media","posts.platforms.linkedin":"LinkedIn","posts.platforms.linkedin-page":"LinkedIn Page","posts.platforms.x":"X","posts.platforms.tiktok":"TikTok","posts.platforms.youtube":"YouTube Shorts","posts.platforms.facebook":"Facebook Page","posts.platforms.instagram":"Instagram","posts.platforms.threads":"Threads","posts.platforms.pinterest":"Pinterest","posts.platforms.bluesky":"Bluesky","posts.platforms.mastodon":"Mastodon","posts.flash.scheduled":"Post scheduled successfully!","posts.flash.publishing":"Post is being published!","posts.flash.deleted":"Post deleted successfully!","posts.flash.cannot_edit_published":"Published posts cannot be edited.","posts.flash.connect_first":"Connect at least one social network before creating a post.","posts.errors.account_disconnected":"Social account is disconnected","settings.title":"Settings","settings.description":"Manage your profile and account settings","settings.nav.profile":"Profile","settings.nav.password":"Password","settings.nav.workspace":"Workspace","settings.nav.members":"Members","settings.nav.billing":"Billing","settings.profile.title":"Profile settings","settings.profile.heading":"Profile information","settings.profile.description":"Update your name and email address","settings.profile.avatar":"Avatar","settings.profile.name":"Name","settings.profile.name_placeholder":"Full name","settings.profile.email":"Email address","settings.profile.email_placeholder":"Email address","settings.profile.email_unverified":"Your email address is unverified.","settings.profile.resend_verification":"Click here to resend the verification email.","settings.profile.verification_sent":"A new verification link has been sent to your email address.","settings.profile.save":"Save","settings.password.title":"Password settings","settings.password.heading":"Update password","settings.password.description":"Ensure your account is using a long, random password to stay secure","settings.password.current_password":"Current password","settings.password.current_password_placeholder":"Current password","settings.password.new_password":"New password","settings.password.new_password_placeholder":"New password","settings.password.confirm_password":"Confirm password","settings.password.confirm_password_placeholder":"Confirm password","settings.password.save":"Save password","settings.delete_account.heading":"Delete account","settings.delete_account.description":"Delete your account and all of its resources","settings.delete_account.warning":"Warning","settings.delete_account.warning_message":"Please proceed with caution, this cannot be undone.","settings.delete_account.button":"Delete account","settings.delete_account.modal_title":"Are you sure you want to delete your account?","settings.delete_account.modal_description":"Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.","settings.delete_account.password":"Password","settings.delete_account.password_placeholder":"Password","settings.delete_account.cancel":"Cancel","settings.delete_account.confirm":"Delete account","settings.workspace.title":"Workspace settings","settings.workspace.heading":"Workspace settings","settings.workspace.description":"Update your workspace name, logo, and timezone","settings.workspace.logo":"Logo","settings.workspace.name":"Name","settings.workspace.name_placeholder":"My Workspace","settings.workspace.timezone":"Timezone","settings.workspace.save":"Save","settings.workspace.saved":"Saved.","settings.members.title":"Members","settings.members.heading":"Team members","settings.members.description":"Manage members and invites for this workspace","settings.members.invite.title":"Invite Member","settings.members.invite.description":"Send an email invite to add collaborators","settings.members.invite.email":"Email","settings.members.invite.email_placeholder":"collaborator@email.com","settings.members.invite.role":"Role","settings.members.invite.role_placeholder":"Select a role","settings.members.invite.submit":"Send Invite","settings.members.invite.cancel_confirm":"Are you sure you want to cancel this invite?","settings.members.pending.title":"Pending Invites","settings.members.pending.description":"Invites awaiting acceptance","settings.members.pending.empty":"No pending invites","settings.members.list.title":"Members","settings.members.list.description":"People with access to this workspace","settings.members.list.empty":"No members besides the owner","settings.members.list.remove_confirm":"Are you sure you want to remove this member?","settings.members.roles.owner":"Owner","settings.members.roles.admin":"Admin","settings.members.roles.member":"Member","settings.members.flash.invite_sent":"Invite sent successfully!","settings.members.flash.invite_deleted":"Invite deleted.","settings.members.flash.member_removed":"Member removed successfully.","settings.members.flash.wrong_email":"This invite is for a different email address.","settings.members.flash.already_member":"You are already a member of this workspace.","settings.members.flash.invite_accepted":"Welcome! You are now a member of the workspace.","settings.members.flash.invite_declined":"Invite declined.","settings.flash.profile_updated":"Profile updated successfully!","settings.flash.language_updated":"Language updated successfully!","settings.flash.password_updated":"Password updated successfully!","settings.flash.workspace_updated":"Settings updated successfully!","sidebar.select_workspace":"Select workspace","sidebar.create_workspace":"Create workspace","sidebar.create_post":"Create post","sidebar.profile":"Profile","sidebar.log_out":"Log out","sidebar.workspace":"Workspace: :name","sidebar.workspace_select":"Workspace: Select","sidebar.theme":"Theme: :name","sidebar.theme_light":"Light","sidebar.theme_dark":"Dark","sidebar.theme_system":"System","sidebar.language":"Language: :name","sidebar.language_select":"Language: Select","sidebar.groups.posts":"Posts","sidebar.groups.configuration":"Configurations","sidebar.groups.support":"Support","sidebar.posts.calendar":"Calendar","sidebar.posts.all":"All","sidebar.posts.scheduled":"Scheduled","sidebar.posts.posted":"Posted","sidebar.posts.drafts":"Drafts","sidebar.config.connections":"Connections","sidebar.config.hashtags":"Hashtags","sidebar.config.labels":"Labels","sidebar.config.settings":"Settings","sidebar.support.discord":"Discord","sidebar.support.share_feedback":"Share feedback","sidebar.support.last_updates":"Last Updates","sidebar.support.docs":"Docs"} \ No newline at end of file diff --git a/lang/php_pt-br.json b/lang/php_pt-br.json deleted file mode 100644 index b71de77d..00000000 --- a/lang/php_pt-br.json +++ /dev/null @@ -1 +0,0 @@ -{"accounts.title":"Conexões","accounts.page_title":"Contas Conectadas","accounts.description":"Conecte suas redes sociais para agendar e publicar posts","accounts.not_connected":"Não conectado","accounts.connect":"Conectar","accounts.connection_lost":"Conexão perdida","accounts.reconnect_account":"Reconectar conta","accounts.view_profile":"Ver perfil","accounts.disconnect":"Desconectar","accounts.disconnect_modal.title":"Desconectar Conta","accounts.disconnect_modal.description":"Tem certeza que deseja desconectar esta conta? Você pode reconectá-la a qualquer momento.","accounts.disconnect_modal.confirm":"Desconectar","accounts.disconnect_modal.cancel":"Cancelar","accounts.bluesky.title":"Conectar Bluesky","accounts.bluesky.description":"Digite suas credenciais para conectar","accounts.bluesky.email":"E-mail","accounts.bluesky.email_placeholder":"seuhandle.bsky.social","accounts.bluesky.app_password":"Senha do App","accounts.bluesky.app_password_placeholder":"xxxx-xxxx-xxxx-xxxx","accounts.bluesky.app_password_hint":"Use uma Senha do App por segurança. Crie uma em bsky.app/settings.","accounts.bluesky.submit":"Conectar Bluesky","accounts.bluesky.submitting":"Conectando...","accounts.mastodon.title":"Conectar Mastodon","accounts.mastodon.description":"Digite a instância do seu Mastodon","accounts.mastodon.instance_url":"URL da Instância","accounts.mastodon.instance_placeholder":"https://mastodon.social","accounts.mastodon.instance_hint":"Digite a URL da sua instância Mastodon (ex: mastodon.social, techhub.social)","accounts.mastodon.submit":"Continuar com Mastodon","accounts.mastodon.submitting":"Conectando...","accounts.facebook.title":"Selecionar Página do Facebook","accounts.facebook.description":"Escolha qual página você deseja conectar","accounts.facebook.no_pages":"Nenhuma página encontrada","accounts.facebook.no_pages_description":"Você não é administrador de nenhuma página do Facebook.","accounts.facebook.page_label":"Página do Facebook","accounts.linkedin.title":"Selecionar Página do LinkedIn","accounts.linkedin.description":"Escolha qual página você deseja conectar","accounts.linkedin.no_pages":"Nenhuma página encontrada","accounts.linkedin.no_pages_description":"Você não é administrador de nenhuma página do LinkedIn.","accounts.linkedin.page_label":"Página do LinkedIn","accounts.flash.disconnected":"Conta desconectada com sucesso!","accounts.flash.connected":"Conta conectada com sucesso!","accounts.flash.session_expired":"Sessão expirada. Por favor, tente novamente.","accounts.flash.workspace_not_found":"Workspace não encontrado.","accounts.flash.already_connected":"Esta plataforma já está conectada.","accounts.flash.no_youtube_channels":"Nenhum canal do YouTube encontrado. Por favor, crie um canal primeiro.","auth.failed":"Essas credenciais não correspondem aos nossos registros.","auth.password":"A senha fornecida está incorreta.","auth.throttle":"Muitas tentativas de login. Por favor, tente novamente em :seconds segundos.","auth.flash.welcome":"Bem-vindo ao TryPost!","auth.flash.welcome_trial":"Bem-vindo ao TryPost! Seu período de teste começou.","auth.login.title":"Entrar na sua conta","auth.login.description":"Digite seu email e senha abaixo para entrar","auth.login.page_title":"Entrar","auth.login.email":"Endereço de email","auth.login.password":"Senha","auth.login.forgot_password":"Esqueceu a senha?","auth.login.remember_me":"Lembrar de mim","auth.login.submit":"Entrar","auth.login.no_account":"Não tem uma conta?","auth.login.sign_up":"Cadastre-se","auth.register.title":"Criar uma conta","auth.register.description":"Digite seus dados abaixo para criar sua conta","auth.register.page_title":"Cadastro","auth.register.name":"Nome","auth.register.name_placeholder":"Nome completo","auth.register.email":"Endereço de email","auth.register.password":"Senha","auth.register.submit":"Criar conta","auth.register.has_account":"Já tem uma conta?","auth.register.log_in":"Entrar","auth.forgot_password.title":"Esqueceu a senha","auth.forgot_password.description":"Digite seu email para receber um link de redefinição de senha","auth.forgot_password.page_title":"Esqueceu a senha","auth.forgot_password.email":"Endereço de email","auth.forgot_password.submit":"Enviar link de redefinição","auth.forgot_password.return_to":"Ou, volte para","auth.forgot_password.log_in":"entrar","auth.reset_password.title":"Redefinir senha","auth.reset_password.description":"Por favor, digite sua nova senha abaixo","auth.reset_password.page_title":"Redefinir senha","auth.reset_password.email":"Email","auth.reset_password.password":"Senha","auth.reset_password.confirm_password":"Confirmar Senha","auth.reset_password.confirm_placeholder":"Confirmar senha","auth.reset_password.submit":"Redefinir senha","auth.verify_email.title":"Verificar email","auth.verify_email.description":"Por favor, verifique seu endereço de email clicando no link que acabamos de enviar.","auth.verify_email.page_title":"Verificação de email","auth.verify_email.link_sent":"Um novo link de verificação foi enviado para o endereço de email que você forneceu durante o cadastro.","auth.verify_email.resend":"Reenviar email de verificação","auth.verify_email.log_out":"Sair","auth.accept_invite.page_title":"Aceitar Convite","auth.accept_invite.title":"Você foi convidado!","auth.accept_invite.description":"Você foi convidado para participar do workspace :workspace.","auth.accept_invite.workspace":"Workspace","auth.accept_invite.your_role":"Seu cargo","auth.accept_invite.email":"Email","auth.accept_invite.accept":"Aceitar Convite","auth.accept_invite.decline":"Recusar Convite","auth.accept_invite.login_prompt":"Entre ou crie uma conta para aceitar este convite.","auth.accept_invite.log_in":"Entrar","auth.accept_invite.create_account":"Criar Conta","billing.title":"Assinatura","billing.description":"Gerencie sua assinatura e método de pagamento","billing.trial.title":"Período de teste ativo","billing.trial.description":"Seu período de teste termina em :date. Após isso, sua assinatura será cobrada automaticamente.","billing.subscription.title":"Sua Assinatura","billing.subscription.workspaces":"Workspaces","billing.subscription.quantity":"Quantidade da assinatura","billing.subscription.expires":"Expira em :date","billing.subscription.canceled_on":"Sua assinatura será cancelada em :date","billing.subscription.manage":"Gerenciar no Stripe","billing.invoices.title":"Faturas","billing.invoices.description":"Histórico de pagamentos","billing.invoices.empty":"Nenhuma fatura encontrada","billing.invoices.paid":"Pago","billing.status.active":"Ativo","billing.status.canceled":"Cancelado","billing.status.incomplete":"Incompleto","billing.status.incomplete_expired":"Expirado","billing.status.past_due":"Vencido","billing.status.trialing":"Teste","billing.status.unpaid":"Não pago","calendar.title":"Calendário","calendar.today":"Hoje","calendar.day":"Dia","calendar.week":"Semana","calendar.month":"Mês","calendar.new_post":"Novo Post","calendar.no_content":"Sem conteúdo","calendar.more":"+:count mais","hashtags.title":"Hashtags","hashtags.description":"Crie grupos de hashtags para adicionar rapidamente aos seus posts","hashtags.new_group":"Novo Grupo","hashtags.no_groups_yet":"Nenhum grupo de hashtags ainda","hashtags.no_groups_description":"Crie grupos de hashtags para adicionar rapidamente hashtags populares aos seus posts","hashtags.create_first_group":"Crie seu primeiro grupo","hashtags.hashtags_count":":count hashtags","hashtags.create.title":"Criar Grupo de Hashtags","hashtags.create.description":"Dê um nome ao grupo e adicione hashtags separadas por espaços ou vírgulas","hashtags.create.name":"Nome do Grupo","hashtags.create.name_placeholder":"ex: Marketing, Viagem, Comida","hashtags.create.hashtags":"Hashtags","hashtags.create.hashtags_placeholder":"#marketing #redessociais #negocios #crescimento","hashtags.create.hashtags_hint":"Digite as hashtags separadas por espaços ou vírgulas. Inclua o símbolo #.","hashtags.create.submit":"Criar Grupo","hashtags.create.submitting":"Criando...","hashtags.edit.title":"Editar Grupo de Hashtags","hashtags.edit.description":"Atualize o nome e as hashtags deste grupo","hashtags.edit.name":"Nome do Grupo","hashtags.edit.name_placeholder":"ex: Marketing, Viagem, Comida","hashtags.edit.hashtags":"Hashtags","hashtags.edit.hashtags_placeholder":"#marketing #redessociais #negocios #crescimento","hashtags.edit.hashtags_hint":"Digite as hashtags separadas por espaços ou vírgulas. Inclua o símbolo #.","hashtags.edit.submit":"Salvar Alterações","hashtags.edit.submitting":"Salvando...","hashtags.delete.title":"Excluir Grupo de Hashtags","hashtags.delete.description":"Tem certeza que deseja excluir este grupo de hashtags? Esta ação não pode ser desfeita.","hashtags.delete.confirm":"Excluir","hashtags.delete.cancel":"Cancelar","hashtags.flash.created":"Grupo de hashtags criado com sucesso!","hashtags.flash.updated":"Grupo de hashtags atualizado com sucesso!","hashtags.flash.deleted":"Grupo de hashtags excluído com sucesso!","labels.title":"Etiquetas","labels.description":"Crie etiquetas para organizar e categorizar seus posts","labels.new_label":"Nova Etiqueta","labels.no_labels_yet":"Nenhuma etiqueta ainda","labels.create_first_label":"Crie sua primeira etiqueta","labels.create.title":"Criar Etiqueta","labels.create.description":"Dê um nome e escolha uma cor para sua etiqueta","labels.create.name":"Nome","labels.create.name_placeholder":"Digite o nome da etiqueta...","labels.create.color":"Cor","labels.create.submit":"Criar Etiqueta","labels.create.submitting":"Criando...","labels.edit.title":"Editar Etiqueta","labels.edit.description":"Atualize o nome e a cor desta etiqueta","labels.edit.name":"Nome","labels.edit.name_placeholder":"Digite o nome da etiqueta...","labels.edit.color":"Cor","labels.edit.submit":"Salvar Alterações","labels.edit.submitting":"Salvando...","labels.delete.title":"Excluir Etiqueta","labels.delete.description":"Tem certeza que deseja excluir esta etiqueta? Esta ação não pode ser desfeita.","labels.delete.confirm":"Excluir","labels.delete.cancel":"Cancelar","labels.flash.created":"Etiqueta criada com sucesso!","labels.flash.updated":"Etiqueta atualizada com sucesso!","labels.flash.deleted":"Etiqueta excluída com sucesso!","mail.workspace_connections_disconnected.subject":"{1} :count conta precisa ser reconectada em :workspace|[2,*] :count contas precisam ser reconectadas em :workspace","mail.workspace_connections_disconnected.title":"Contas Precisam ser Reconectadas","mail.workspace_connections_disconnected.intro":"As seguintes contas de redes sociais no seu workspace :workspace foram desconectadas e precisam ser reconectadas:","mail.workspace_connections_disconnected.reasons_title":"Isso pode ter acontecido porque:","mail.workspace_connections_disconnected.reason_expired":"Os tokens de acesso expiraram","mail.workspace_connections_disconnected.reason_revoked":"Você revogou o acesso ao TryPost na plataforma","mail.workspace_connections_disconnected.reason_changed":"A plataforma mudou os requisitos de autenticação","mail.workspace_connections_disconnected.reconnect_cta":"Por favor, reconecte essas contas para continuar agendando e publicando posts.","mail.workspace_connections_disconnected.button":"Reconectar Contas","pagination.previous":"« Anterior","pagination.next":"Próximo »","passwords.reset":"Sua senha foi redefinida.","passwords.sent":"Enviamos o link de redefinição de senha por e-mail.","passwords.throttled":"Por favor, aguarde antes de tentar novamente.","passwords.token":"Este token de redefinição de senha é inválido.","passwords.user":"Não conseguimos encontrar um usuário com esse endereço de e-mail.","posts.title":"Posts","posts.all_posts":"Todos os Posts","posts.new_post":"Novo Post","posts.no_posts":"Nenhum post encontrado","posts.start_creating":"Comece criando seu primeiro post.","posts.manage_posts":"Gerencie todos os seus posts","posts.delete_confirm":"Tem certeza que deseja excluir este post?","posts.by":"por","posts.actions.view":"Ver post","posts.actions.delete":"Excluir post","posts.form.post_type":"Tipo de Post","posts.form.board":"Pasta","posts.form.select_board":"Selecione uma pasta","posts.form.search_board":"Buscar pasta...","posts.form.no_board_found":"Nenhuma pasta encontrada","posts.form.media":"Mídia","posts.form.min":"Mín","posts.form.uploading":"Enviando...","posts.form.drop_to_upload":"Solte para enviar","posts.form.drag_and_drop":"Arraste e solte ou clique para enviar","posts.form.photos_and_videos":"Fotos e vídeos","posts.form.photos_only":"Apenas fotos","posts.form.videos_only":"Apenas vídeos","posts.form.drag_to_reorder":"Arraste para reordenar","posts.form.caption":"Legenda","posts.form.write_caption":"Escreva sua legenda...","posts.status.draft":"Rascunho","posts.status.scheduled":"Agendado","posts.status.publishing":"Publicando","posts.status.published":"Publicado","posts.status.partially_published":"Parcialmente Publicado","posts.status.failed":"Falhou","posts.descriptions.draft":"Posts aguardando agendamento","posts.descriptions.scheduled":"Posts agendados para publicação","posts.descriptions.published":"Posts já publicados","posts.edit.title":"Editar Post","posts.edit.view_title":"Visualizar Post","posts.edit.manage_platforms":"Gerenciar plataformas","posts.edit.sync":"Sincronizar","posts.edit.labels":"Etiquetas","posts.edit.hashtags":"Hashtags","posts.edit.schedule":"Agendar","posts.edit.publish":"Publicar","posts.edit.delete":"Excluir","posts.edit.settings":"Configurações","posts.edit.schedule_for":"Agendar para","posts.edit.saving":"Salvando...","posts.edit.saved":"Salvo","posts.edit.scheduled_at":"Agendado:","posts.edit.published_at":"Publicado:","posts.edit.media":"Mídia","posts.edit.caption":"Legenda","posts.edit.no_caption":"Sem legenda","posts.edit.no_content":"Sem conteúdo","posts.edit.empty_state.title":"Nenhuma plataforma selecionada","posts.edit.empty_state.description":"Selecione pelo menos uma plataforma para criar seu post","posts.edit.delete_modal.title":"Excluir Post","posts.edit.delete_modal.description":"Tem certeza que deseja excluir este post? Esta ação não pode ser desfeita.","posts.edit.delete_modal.action":"Excluir","posts.edit.delete_modal.cancel":"Cancelar","posts.edit.sync_enable.title":"Ativar sincronização?","posts.edit.sync_enable.description":"Todas as plataformas compartilharão o mesmo conteúdo. Qualquer edição personalizada feita em plataformas individuais será substituída pelo conteúdo atual.","posts.edit.sync_enable.cancel":"Cancelar","posts.edit.sync_enable.action":"Ativar sincronização","posts.edit.sync_disable.title":"Desativar sincronização?","posts.edit.sync_disable.description":"Cada plataforma manterá seu conteúdo atual, mas edições futuras serão aplicadas apenas à plataforma que você estiver editando.","posts.edit.sync_disable.customize_note":"Você poderá personalizar o conteúdo para cada plataforma individualmente.","posts.edit.sync_disable.cancel":"Cancelar","posts.edit.sync_disable.action":"Desativar sincronização","posts.edit.platforms_dialog.title":"Selecionar Plataformas","posts.edit.platforms_dialog.description":"Escolha em quais plataformas publicar este post.","posts.edit.hashtags_modal.search":"Buscar hashtags...","posts.edit.hashtags_modal.no_results":"Nenhuma hashtag encontrada.","posts.edit.validation.select_board":"Selecione uma pasta","posts.edit.validation.images_not_supported":"Imagens não suportadas","posts.edit.validation.videos_not_supported":"Vídeos não suportados","posts.edit.validation.max_images":"Máx :count imagens","posts.edit.validation.requires_media":"Requer mídia","posts.edit.validation.exceeded":":count excedido","posts.edit.validation.does_not_support_images":":platform não suporta imagens","posts.edit.validation.supports_up_to_images":":platform suporta até :count imagens","posts.edit.validation.does_not_support_videos":":platform não suporta vídeos","posts.content_types.instagram_feed.label":"Post do Feed","posts.content_types.instagram_feed.description":"Aparece no seu feed e perfil","posts.content_types.instagram_reel.label":"Reels","posts.content_types.instagram_reel.description":"Vídeo curto de até 90 segundos","posts.content_types.instagram_story.label":"Story","posts.content_types.instagram_story.description":"Desaparece após 24 horas","posts.content_types.linkedin_post.label":"Post","posts.content_types.linkedin_post.description":"Post padrão com texto e mídia","posts.content_types.linkedin_carousel.label":"Carrossel","posts.content_types.linkedin_carousel.description":"Imagens deslizáveis","posts.content_types.linkedin_page_post.label":"Post","posts.content_types.linkedin_page_post.description":"Post padrão com texto e mídia","posts.content_types.linkedin_page_carousel.label":"Carrossel","posts.content_types.linkedin_page_carousel.description":"Imagens deslizáveis","posts.content_types.facebook_post.label":"Post","posts.content_types.facebook_post.description":"Post padrão na sua página","posts.content_types.facebook_reel.label":"Reels","posts.content_types.facebook_reel.description":"Vídeo curto de até 90 segundos","posts.content_types.facebook_story.label":"Story","posts.content_types.facebook_story.description":"Desaparece após 24 horas","posts.content_types.tiktok_video.label":"Vídeo","posts.content_types.tiktok_video.description":"Conteúdo de vídeo curto","posts.content_types.youtube_short.label":"Short","posts.content_types.youtube_short.description":"Vídeo vertical de até 60 segundos","posts.content_types.x_post.label":"Post","posts.content_types.x_post.description":"Tweet com texto e mídia","posts.content_types.threads_post.label":"Post","posts.content_types.threads_post.description":"Post de texto com mídia opcional","posts.content_types.pinterest_pin.label":"Pin","posts.content_types.pinterest_pin.description":"Pin de imagem com link","posts.content_types.pinterest_video_pin.label":"Pin de Vídeo","posts.content_types.pinterest_video_pin.description":"Conteúdo em vídeo","posts.content_types.pinterest_carousel.label":"Carrossel","posts.content_types.pinterest_carousel.description":"2-5 imagens","posts.content_types.bluesky_post.label":"Post","posts.content_types.bluesky_post.description":"Post de texto com imagens opcionais","posts.content_types.mastodon_post.label":"Post","posts.content_types.mastodon_post.description":"Post de texto com mídia opcional","posts.platforms.linkedin":"LinkedIn","posts.platforms.linkedin-page":"Página do LinkedIn","posts.platforms.x":"X","posts.platforms.tiktok":"TikTok","posts.platforms.youtube":"YouTube Shorts","posts.platforms.facebook":"Página do Facebook","posts.platforms.instagram":"Instagram","posts.platforms.threads":"Threads","posts.platforms.pinterest":"Pinterest","posts.platforms.bluesky":"Bluesky","posts.platforms.mastodon":"Mastodon","posts.flash.scheduled":"Post agendado com sucesso!","posts.flash.publishing":"Post está sendo publicado!","posts.flash.deleted":"Post excluído com sucesso!","posts.flash.cannot_edit_published":"Posts publicados não podem ser editados.","posts.flash.connect_first":"Conecte pelo menos uma rede social antes de criar um post.","posts.errors.account_disconnected":"Conta social está desconectada","settings.title":"Configurações","settings.description":"Gerencie seu perfil e configurações da conta","settings.nav.profile":"Perfil","settings.nav.password":"Senha","settings.nav.workspace":"Workspace","settings.nav.members":"Membros","settings.nav.billing":"Faturamento","settings.profile.title":"Configurações do perfil","settings.profile.heading":"Informações do perfil","settings.profile.description":"Atualize seu nome e endereço de e-mail","settings.profile.avatar":"Avatar","settings.profile.name":"Nome","settings.profile.name_placeholder":"Nome completo","settings.profile.email":"Endereço de e-mail","settings.profile.email_placeholder":"Endereço de e-mail","settings.profile.email_unverified":"Seu endereço de e-mail não foi verificado.","settings.profile.resend_verification":"Clique aqui para reenviar o e-mail de verificação.","settings.profile.verification_sent":"Um novo link de verificação foi enviado para seu endereço de e-mail.","settings.profile.save":"Salvar","settings.password.title":"Configurações de senha","settings.password.heading":"Atualizar senha","settings.password.description":"Certifique-se de que sua conta esteja usando uma senha longa e aleatória para se manter seguro","settings.password.current_password":"Senha atual","settings.password.current_password_placeholder":"Senha atual","settings.password.new_password":"Nova senha","settings.password.new_password_placeholder":"Nova senha","settings.password.confirm_password":"Confirmar senha","settings.password.confirm_password_placeholder":"Confirmar senha","settings.password.save":"Salvar senha","settings.delete_account.heading":"Excluir conta","settings.delete_account.description":"Exclua sua conta e todos os seus recursos","settings.delete_account.warning":"Atenção","settings.delete_account.warning_message":"Por favor, prossiga com cuidado, isso não pode ser desfeito.","settings.delete_account.button":"Excluir conta","settings.delete_account.modal_title":"Tem certeza que deseja excluir sua conta?","settings.delete_account.modal_description":"Uma vez que sua conta for excluída, todos os seus recursos e dados também serão permanentemente excluídos. Por favor, digite sua senha para confirmar que deseja excluir permanentemente sua conta.","settings.delete_account.password":"Senha","settings.delete_account.password_placeholder":"Senha","settings.delete_account.cancel":"Cancelar","settings.delete_account.confirm":"Excluir conta","settings.workspace.title":"Configurações do workspace","settings.workspace.heading":"Configurações do workspace","settings.workspace.description":"Atualize o nome, logo e fuso horário do workspace","settings.workspace.logo":"Logo","settings.workspace.name":"Nome","settings.workspace.name_placeholder":"Meu Workspace","settings.workspace.timezone":"Fuso horário","settings.workspace.save":"Salvar","settings.workspace.saved":"Salvo.","settings.members.title":"Membros","settings.members.heading":"Membros da equipe","settings.members.description":"Gerencie membros e convites deste workspace","settings.members.invite.title":"Convidar Membro","settings.members.invite.description":"Envie um convite por e-mail para adicionar colaboradores","settings.members.invite.email":"E-mail","settings.members.invite.email_placeholder":"colaborador@email.com","settings.members.invite.role":"Função","settings.members.invite.role_placeholder":"Selecione uma função","settings.members.invite.submit":"Enviar Convite","settings.members.invite.cancel_confirm":"Tem certeza que deseja cancelar este convite?","settings.members.pending.title":"Convites Pendentes","settings.members.pending.description":"Convites aguardando aceitação","settings.members.pending.empty":"Nenhum convite pendente","settings.members.list.title":"Membros","settings.members.list.description":"Pessoas com acesso a este workspace","settings.members.list.empty":"Nenhum membro além do proprietário","settings.members.list.remove_confirm":"Tem certeza que deseja remover este membro?","settings.members.roles.owner":"Proprietário","settings.members.roles.admin":"Administrador","settings.members.roles.member":"Membro","settings.members.flash.invite_sent":"Convite enviado com sucesso!","settings.members.flash.invite_deleted":"Convite excluído.","settings.members.flash.member_removed":"Membro removido com sucesso.","settings.members.flash.wrong_email":"Este convite é para um endereço de e-mail diferente.","settings.members.flash.already_member":"Você já é membro deste workspace.","settings.members.flash.invite_accepted":"Bem-vindo! Você agora é membro do workspace.","settings.members.flash.invite_declined":"Convite recusado.","settings.flash.profile_updated":"Perfil atualizado com sucesso!","settings.flash.language_updated":"Idioma atualizado com sucesso!","settings.flash.password_updated":"Senha atualizada com sucesso!","settings.flash.workspace_updated":"Configurações atualizadas com sucesso!","sidebar.select_workspace":"Selecionar workspace","sidebar.create_workspace":"Criar workspace","sidebar.create_post":"Novo post","sidebar.profile":"Perfil","sidebar.log_out":"Sair","sidebar.workspace":"Workspace: :name","sidebar.workspace_select":"Workspace: Selecionar","sidebar.theme":"Tema: :name","sidebar.theme_light":"Claro","sidebar.theme_dark":"Escuro","sidebar.theme_system":"Sistema","sidebar.language":"Idioma: :name","sidebar.language_select":"Idioma: Selecionar","sidebar.groups.posts":"Posts","sidebar.groups.configuration":"Configurações","sidebar.groups.support":"Suporte","sidebar.posts.calendar":"Calendário","sidebar.posts.all":"Todos","sidebar.posts.scheduled":"Agendados","sidebar.posts.posted":"Publicados","sidebar.posts.drafts":"Rascunhos","sidebar.config.connections":"Conexões","sidebar.config.hashtags":"Hashtags","sidebar.config.labels":"Etiquetas","sidebar.config.settings":"Configurações","sidebar.support.discord":"Discord","sidebar.support.share_feedback":"Enviar feedback","sidebar.support.last_updates":"Últimas Atualizações","sidebar.support.docs":"Documentação","validation.accepted":"O campo :attribute deve ser aceito.","validation.accepted_if":"O campo :attribute deve ser aceito quando :other for :value.","validation.active_url":"O campo :attribute deve ser uma URL válida.","validation.after":"O campo :attribute deve ser uma data posterior a :date.","validation.after_or_equal":"O campo :attribute deve ser uma data posterior ou igual a :date.","validation.alpha":"O campo :attribute deve conter apenas letras.","validation.alpha_dash":"O campo :attribute deve conter apenas letras, números, hifens e underscores.","validation.alpha_num":"O campo :attribute deve conter apenas letras e números.","validation.any_of":"O campo :attribute é inválido.","validation.array":"O campo :attribute deve ser um array.","validation.ascii":"O campo :attribute deve conter apenas caracteres alfanuméricos e símbolos de um byte.","validation.before":"O campo :attribute deve ser uma data anterior a :date.","validation.before_or_equal":"O campo :attribute deve ser uma data anterior ou igual a :date.","validation.between.array":"O campo :attribute deve ter entre :min e :max itens.","validation.between.file":"O campo :attribute deve estar entre :min e :max kilobytes.","validation.between.numeric":"O campo :attribute deve estar entre :min e :max.","validation.between.string":"O campo :attribute deve estar entre :min e :max caracteres.","validation.boolean":"O campo :attribute deve ser verdadeiro ou falso.","validation.can":"O campo :attribute contém um valor não autorizado.","validation.confirmed":"A confirmação do campo :attribute não corresponde.","validation.contains":"O campo :attribute está faltando um valor obrigatório.","validation.current_password":"A senha está incorreta.","validation.date":"O campo :attribute deve ser uma data válida.","validation.date_equals":"O campo :attribute deve ser uma data igual a :date.","validation.date_format":"O campo :attribute deve corresponder ao formato :format.","validation.decimal":"O campo :attribute deve ter :decimal casas decimais.","validation.declined":"O campo :attribute deve ser recusado.","validation.declined_if":"O campo :attribute deve ser recusado quando :other for :value.","validation.different":"O campo :attribute e :other devem ser diferentes.","validation.digits":"O campo :attribute deve ter :digits dígitos.","validation.digits_between":"O campo :attribute deve ter entre :min e :max dígitos.","validation.dimensions":"O campo :attribute deve ter dimensões de imagem válidas.","validation.distinct":"O campo :attribute tem um valor duplicado.","validation.doesnt_contain":"O campo :attribute não deve conter nenhum dos seguintes: :values.","validation.doesnt_end_with":"O campo :attribute não deve terminar com nenhum dos seguintes: :values.","validation.doesnt_start_with":"O campo :attribute não deve começar com nenhum dos seguintes: :values.","validation.email":"O campo :attribute deve ser um endereço de e-mail válido.","validation.encoding":"O campo :attribute deve ser codificado em :encoding.","validation.ends_with":"O campo :attribute deve terminar com um dos seguintes: :values.","validation.enum":"O :attribute selecionado é inválido.","validation.exists":"O :attribute selecionado é inválido.","validation.extensions":"O campo :attribute deve ter uma das seguintes extensões: :values.","validation.file":"O campo :attribute deve ser um arquivo.","validation.filled":"O campo :attribute deve ter um valor.","validation.gt.array":"O campo :attribute deve ter mais de :value itens.","validation.gt.file":"O campo :attribute deve ser maior que :value kilobytes.","validation.gt.numeric":"O campo :attribute deve ser maior que :value.","validation.gt.string":"O campo :attribute deve ser maior que :value caracteres.","validation.gte.array":"O campo :attribute deve ter :value itens ou mais.","validation.gte.file":"O campo :attribute deve ser maior ou igual a :value kilobytes.","validation.gte.numeric":"O campo :attribute deve ser maior ou igual a :value.","validation.gte.string":"O campo :attribute deve ser maior ou igual a :value caracteres.","validation.hex_color":"O campo :attribute deve ser uma cor hexadecimal válida.","validation.image":"O campo :attribute deve ser uma imagem.","validation.in":"O :attribute selecionado é inválido.","validation.in_array":"O campo :attribute deve existir em :other.","validation.in_array_keys":"O campo :attribute deve conter pelo menos uma das seguintes chaves: :values.","validation.integer":"O campo :attribute deve ser um inteiro.","validation.ip":"O campo :attribute deve ser um endereço IP válido.","validation.ipv4":"O campo :attribute deve ser um endereço IPv4 válido.","validation.ipv6":"O campo :attribute deve ser um endereço IPv6 válido.","validation.json":"O campo :attribute deve ser uma string JSON válida.","validation.list":"O campo :attribute deve ser uma lista.","validation.lowercase":"O campo :attribute deve estar em minúsculas.","validation.lt.array":"O campo :attribute deve ter menos de :value itens.","validation.lt.file":"O campo :attribute deve ser menor que :value kilobytes.","validation.lt.numeric":"O campo :attribute deve ser menor que :value.","validation.lt.string":"O campo :attribute deve ser menor que :value caracteres.","validation.lte.array":"O campo :attribute deve ter :value itens ou menos.","validation.lte.file":"O campo :attribute deve ser menor ou igual a :value kilobytes.","validation.lte.numeric":"O campo :attribute deve ser menor ou igual a :value.","validation.lte.string":"O campo :attribute deve ser menor ou igual a :value caracteres.","validation.mac_address":"O campo :attribute deve ser um endereço MAC válido.","validation.max.array":"O campo :attribute deve ter no máximo :max itens.","validation.max.file":"O campo :attribute deve ter no máximo :max kilobytes.","validation.max.numeric":"O campo :attribute deve ter no máximo :max.","validation.max.string":"O campo :attribute deve ter no máximo :max caracteres.","validation.max_digits":"O campo :attribute não deve ter mais que :max dígitos.","validation.mimes":"O campo :attribute deve ser um arquivo do tipo: :values.","validation.mimetypes":"O campo :attribute deve ser um arquivo do tipo: :values.","validation.min.array":"O campo :attribute deve ter pelo menos :min itens.","validation.min.file":"O campo :attribute deve ter pelo menos :min kilobytes.","validation.min.numeric":"O campo :attribute deve ter pelo menos :min.","validation.min.string":"O campo :attribute deve ter pelo menos :min caracteres.","validation.min_digits":"O campo :attribute deve ter pelo menos :min dígitos.","validation.missing":"O campo :attribute deve estar ausente.","validation.missing_if":"O campo :attribute deve estar ausente quando :other for :value.","validation.missing_unless":"O campo :attribute deve estar ausente a menos que :other seja :value.","validation.missing_with":"O campo :attribute deve estar ausente quando :values estiver presente.","validation.missing_with_all":"O campo :attribute deve estar ausente quando :values estiverem presentes.","validation.multiple_of":"O campo :attribute deve ser um múltiplo de :value.","validation.not_in":"O :attribute selecionado é inválido.","validation.not_regex":"O formato do campo :attribute é inválido.","validation.numeric":"O campo :attribute deve ser um número.","validation.password.letters":"O campo :attribute deve conter pelo menos uma letra.","validation.password.mixed":"O campo :attribute deve conter pelo menos uma letra maiúscula e uma minúscula.","validation.password.numbers":"O campo :attribute deve conter pelo menos um número.","validation.password.symbols":"O campo :attribute deve conter pelo menos um símbolo.","validation.password.uncompromised":"O :attribute fornecido apareceu em um vazamento de dados. Por favor, escolha um :attribute diferente.","validation.present":"O campo :attribute deve estar presente.","validation.present_if":"O campo :attribute deve estar presente quando :other for :value.","validation.present_unless":"O campo :attribute deve estar presente a menos que :other seja :value.","validation.present_with":"O campo :attribute deve estar presente quando :values estiver presente.","validation.present_with_all":"O campo :attribute deve estar presente quando :values estiverem presentes.","validation.prohibited":"O campo :attribute é proibido.","validation.prohibited_if":"O campo :attribute é proibido quando :other for :value.","validation.prohibited_if_accepted":"O campo :attribute é proibido quando :other for aceito.","validation.prohibited_if_declined":"O campo :attribute é proibido quando :other for recusado.","validation.prohibited_unless":"O campo :attribute é proibido a menos que :other esteja em :values.","validation.prohibits":"O campo :attribute proíbe :other de estar presente.","validation.regex":"O formato do campo :attribute é inválido.","validation.required":"O campo :attribute é obrigatório.","validation.required_array_keys":"O campo :attribute deve conter entradas para: :values.","validation.required_if":"O campo :attribute é obrigatório quando :other for :value.","validation.required_if_accepted":"O campo :attribute é obrigatório quando :other for aceito.","validation.required_if_declined":"O campo :attribute é obrigatório quando :other for recusado.","validation.required_unless":"O campo :attribute é obrigatório a menos que :other esteja em :values.","validation.required_with":"O campo :attribute é obrigatório quando :values estiver presente.","validation.required_with_all":"O campo :attribute é obrigatório quando :values estiverem presentes.","validation.required_without":"O campo :attribute é obrigatório quando :values não estiver presente.","validation.required_without_all":"O campo :attribute é obrigatório quando nenhum dos :values estiver presente.","validation.same":"O campo :attribute deve ser igual a :other.","validation.size.array":"O campo :attribute deve conter :size itens.","validation.size.file":"O campo :attribute deve ter :size kilobytes.","validation.size.numeric":"O campo :attribute deve ser :size.","validation.size.string":"O campo :attribute deve ter :size caracteres.","validation.starts_with":"O campo :attribute deve começar com um dos seguintes: :values.","validation.string":"O campo :attribute deve ser uma string.","validation.timezone":"O campo :attribute deve ser um fuso horário válido.","validation.unique":"O :attribute já foi utilizado.","validation.uploaded":"O :attribute falhou ao ser enviado.","validation.uppercase":"O campo :attribute deve estar em maiúsculo.","validation.url":"O campo :attribute deve ser uma URL válida.","validation.ulid":"O campo :attribute deve ser um ULID válido.","validation.uuid":"O campo :attribute deve ser um UUID válido.","validation.custom.attribute-name.rule-name":"custom-message"} \ No newline at end of file diff --git a/resources/js/components/AppHeader.vue b/resources/js/components/AppHeader.vue index 77604597..45c1bc5b 100644 --- a/resources/js/components/AppHeader.vue +++ b/resources/js/components/AppHeader.vue @@ -29,7 +29,7 @@ import UserMenuContent from '@/components/UserMenuContent.vue'; import WorkspaceSwitcher from '@/components/WorkspaceSwitcher.vue'; import { useActiveUrl } from '@/composables/useActiveUrl'; import { getInitials } from '@/composables/useInitials'; -import { calendar } from '@/routes'; +import { calendar } from '@/routes/app'; import type { BreadcrumbItem, NavItem } from '@/types'; interface Props { diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vue index 1ca17e10..22a88daf 100644 --- a/resources/js/components/AppSidebar.vue +++ b/resources/js/components/AppSidebar.vue @@ -4,9 +4,9 @@ import { IconBrandDiscord, IconCalendar, IconSelector, IconFileText, IconHash, I import { loadLanguageAsync, trans } from 'laravel-vue-i18n'; import { computed } from 'vue'; -import { store as storePost } from '@/actions/App/Http/Controllers/PostController'; -import { index as postsIndex } from '@/actions/App/Http/Controllers/PostController'; -import { updateLanguage } from '@/actions/App/Http/Controllers/Settings/ProfileController'; +import { store as storePost } from '@/actions/App/Http/Controllers/App/PostController'; +import { index as postsIndex } from '@/actions/App/Http/Controllers/App/PostController'; +import { updateLanguage } from '@/actions/App/Http/Controllers/App/Settings/ProfileController'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; import { Button } from '@/components/ui/button'; import { @@ -40,12 +40,13 @@ import { import { useAppearance } from '@/composables/useAppearance'; import { useInitials } from '@/composables/useInitials'; import dayjs from '@/dayjs'; -import { accounts, calendar, logout } from '@/routes'; -import { index as hashtags } from '@/routes/hashtags'; -import { index as labels } from '@/routes/labels'; -import { edit as editProfile } from '@/routes/profile'; -import { settings as workspaceSettings } from '@/routes/workspace'; -import { create as createWorkspaceRoute, switchMethod } from '@/routes/workspaces'; +import { logout } from '@/routes'; +import { accounts, calendar } from '@/routes/app'; +import { index as hashtags } from '@/routes/app/hashtags'; +import { index as labels } from '@/routes/app/labels'; +import { edit as editProfile } from '@/routes/app/profile'; +import { settings as workspaceSettings } from '@/routes/app/workspace'; +import { create as createWorkspaceRoute, switchMethod } from '@/routes/app/workspaces'; import type { NavItem } from '@/types'; interface Workspace { diff --git a/resources/js/components/DeleteUser.vue b/resources/js/components/DeleteUser.vue index 3b9e5f15..80ef9fab 100644 --- a/resources/js/components/DeleteUser.vue +++ b/resources/js/components/DeleteUser.vue @@ -3,7 +3,7 @@ import { Form } from '@inertiajs/vue3'; import { trans } from 'laravel-vue-i18n'; import { useTemplateRef } from 'vue'; -import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileController'; +import ProfileController from '@/actions/App/Http/Controllers/App/Settings/ProfileController'; import HeadingSmall from '@/components/HeadingSmall.vue'; import InputError from '@/components/InputError.vue'; import { Button } from '@/components/ui/button'; diff --git a/resources/js/components/PhotoUpload.vue b/resources/js/components/PhotoUpload.vue index b15f9bdb..34dd95b6 100644 --- a/resources/js/components/PhotoUpload.vue +++ b/resources/js/components/PhotoUpload.vue @@ -17,7 +17,7 @@ import { TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip'; -import { store as storeMedia, destroy as destroyMedia } from '@/routes/medias'; +import { store as storeMedia, destroy as destroyMedia } from '@/routes/app/medias'; interface Photo { url: string; diff --git a/resources/js/components/UserMenuContent.vue b/resources/js/components/UserMenuContent.vue index 10519273..86b19e3b 100644 --- a/resources/js/components/UserMenuContent.vue +++ b/resources/js/components/UserMenuContent.vue @@ -10,7 +10,7 @@ import { } from '@/components/ui/dropdown-menu'; import UserInfo from '@/components/UserInfo.vue'; import { logout } from '@/routes'; -import { edit } from '@/routes/profile'; +import { edit } from '@/routes/app/profile'; import type { User } from '@/types'; interface Props { diff --git a/resources/js/components/WorkspaceSwitcher.vue b/resources/js/components/WorkspaceSwitcher.vue index e5636997..f46febb5 100644 --- a/resources/js/components/WorkspaceSwitcher.vue +++ b/resources/js/components/WorkspaceSwitcher.vue @@ -12,7 +12,7 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; -import { create as createWorkspaceRoute, switchMethod } from '@/routes/workspaces'; +import { create as createWorkspaceRoute, switchMethod } from '@/routes/app/workspaces'; interface Workspace { id: string; diff --git a/resources/js/components/hashtags/CreateDialog.vue b/resources/js/components/hashtags/CreateDialog.vue index 1fee1e06..0768fb18 100644 --- a/resources/js/components/hashtags/CreateDialog.vue +++ b/resources/js/components/hashtags/CreateDialog.vue @@ -14,7 +14,7 @@ import { import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; -import { store as hashtagsStore } from '@/routes/hashtags'; +import { store as hashtagsStore } from '@/routes/app/hashtags'; const open = defineModel('open', { default: false }); diff --git a/resources/js/components/hashtags/EditDialog.vue b/resources/js/components/hashtags/EditDialog.vue index 12327859..fc20280a 100644 --- a/resources/js/components/hashtags/EditDialog.vue +++ b/resources/js/components/hashtags/EditDialog.vue @@ -15,7 +15,7 @@ import { import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; -import { update as hashtagsUpdate } from '@/routes/hashtags'; +import { update as hashtagsUpdate } from '@/routes/app/hashtags'; interface Hashtag { id: string; diff --git a/resources/js/components/labels/CreateDialog.vue b/resources/js/components/labels/CreateDialog.vue index 55da73f2..3cc7f86b 100644 --- a/resources/js/components/labels/CreateDialog.vue +++ b/resources/js/components/labels/CreateDialog.vue @@ -13,7 +13,7 @@ import { } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; -import { store as labelsStore } from '@/routes/labels'; +import { store as labelsStore } from '@/routes/app/labels'; const open = defineModel('open', { default: false }); diff --git a/resources/js/components/labels/EditDialog.vue b/resources/js/components/labels/EditDialog.vue index b721a79e..b9ee232c 100644 --- a/resources/js/components/labels/EditDialog.vue +++ b/resources/js/components/labels/EditDialog.vue @@ -14,7 +14,7 @@ import { } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; -import { update as labelsUpdate } from '@/routes/labels'; +import { update as labelsUpdate } from '@/routes/app/labels'; interface LabelType { id: string; diff --git a/resources/js/composables/useMediaManager.ts b/resources/js/composables/useMediaManager.ts index 58c377eb..b77cc600 100644 --- a/resources/js/composables/useMediaManager.ts +++ b/resources/js/composables/useMediaManager.ts @@ -7,7 +7,7 @@ import { destroy as destroyMedia, duplicate as duplicateMedia, reorder as reorderMedia, -} from '@/actions/App/Http/Controllers/MediaController'; +} from '@/actions/App/Http/Controllers/App/MediaController'; import { getMediaRulesForContentType } from '@/composables/useMediaRules'; import { uploadChunked, shouldUseChunkedUpload } from '@/utils/chunkedUpload'; diff --git a/resources/js/layouts/OnboardingLayout.vue b/resources/js/layouts/OnboardingLayout.vue index 60932515..2f859c55 100644 --- a/resources/js/layouts/OnboardingLayout.vue +++ b/resources/js/layouts/OnboardingLayout.vue @@ -1,7 +1,7 @@ + + diff --git a/routes/mcp.php b/routes/mcp.php new file mode 100644 index 00000000..92f6d3b7 --- /dev/null +++ b/routes/mcp.php @@ -0,0 +1,14 @@ + 'mcp.'.parse_url(config('app.url'), PHP_URL_HOST), + ], + function () { + // + } +); diff --git a/routes/settings.php b/routes/settings.php deleted file mode 100644 index 07fd5a62..00000000 --- a/routes/settings.php +++ /dev/null @@ -1,21 +0,0 @@ -group(function () { - Route::get('settings/profile', [ProfileController::class, 'edit'])->name('profile.edit'); - Route::patch('settings/profile', [ProfileController::class, 'update'])->name('profile.update'); - Route::patch('settings/language', [ProfileController::class, 'updateLanguage'])->name('profile.language'); -}); - -Route::middleware(['auth', 'verified'])->group(function () { - Route::delete('settings/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); - - Route::get('settings/password', [PasswordController::class, 'edit'])->name('user-password.edit'); - - Route::put('settings/password', [PasswordController::class, 'update']) - ->middleware('throttle:6,1') - ->name('user-password.update'); -}); diff --git a/tests/Feature/Api/ApiKeyApiTest.php b/tests/Feature/Api/ApiKeyApiTest.php new file mode 100644 index 00000000..c9731997 --- /dev/null +++ b/tests/Feature/Api/ApiKeyApiTest.php @@ -0,0 +1,127 @@ +create(); + + $factoryOverrides = collect($overrides)->except('workspace')->toArray(); + + $apiToken = ApiToken::factory()->create(array_merge([ + 'workspace_id' => $workspace->id, + 'token_lookup' => substr($plainToken, 3, 16), + 'token_hash' => Hash::make($plainToken), + ], $factoryOverrides)); + + return [ + 'token' => $apiToken, + 'plain_token' => $plainToken, + 'workspace' => $workspace, + ]; +} + +test('list api keys', function () { + $result = createApiKeyApiToken(); + + // The authenticating token itself is one, create two more + ApiToken::factory()->count(2)->create([ + 'workspace_id' => $result['workspace']->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->getJson( + route('api.api-keys.index'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertOk(); + $response->assertJsonCount(3); +}); + +test('create api key returns plain token', function () { + $result = createApiKeyApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->postJson( + route('api.api-keys.store'), + [ + 'name' => 'CI/CD Token', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertCreated(); + $response->assertJsonStructure([ + 'token' => ['id', 'name', 'key_hint', 'status'], + 'plain_token', + ]); + + $plainToken = $response->json('plain_token'); + expect($plainToken)->toStartWith('tp_'); + expect(strlen($plainToken))->toBe(51); +}); + +test('create api key validation errors', function () { + $result = createApiKeyApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->postJson( + route('api.api-keys.store'), + [], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnprocessable(); + $response->assertJsonValidationErrors(['name']); +}); + +test('delete api key', function () { + $result = createApiKeyApiToken(); + + $tokenToDelete = ApiToken::factory()->create([ + 'workspace_id' => $result['workspace']->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->deleteJson( + route('api.api-keys.destroy', $tokenToDelete), + [], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertNoContent(); + + expect(ApiToken::find($tokenToDelete->id))->toBeNull(); +}); + +test('cannot delete api key from another workspace', function () { + $result = createApiKeyApiToken(); + + $otherWorkspace = Workspace::factory()->create(); + $otherToken = ApiToken::factory()->create([ + 'workspace_id' => $otherWorkspace->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->deleteJson( + route('api.api-keys.destroy', $otherToken), + [], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertNotFound(); +}); diff --git a/tests/Feature/Api/AuthenticateApiTokenTest.php b/tests/Feature/Api/AuthenticateApiTokenTest.php new file mode 100644 index 00000000..40a17844 --- /dev/null +++ b/tests/Feature/Api/AuthenticateApiTokenTest.php @@ -0,0 +1,117 @@ +create(); + + $factoryOverrides = collect($overrides)->except('workspace')->toArray(); + + $apiToken = ApiToken::factory()->create(array_merge([ + 'workspace_id' => $workspace->id, + 'token_lookup' => substr($plainToken, 3, 16), + 'token_hash' => Hash::make($plainToken), + ], $factoryOverrides)); + + return [ + 'token' => $apiToken, + 'plain_token' => $plainToken, + 'workspace' => $workspace, + ]; +} + +test('returns 401 without token', function () { + $response = $this->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnauthorized(); + $response->assertJson(['message' => 'Missing API key.']); +}); + +test('returns 401 with invalid token format', function () { + $response = $this->withHeaders([ + 'Authorization' => 'Bearer invalid-token', + ])->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnauthorized(); + $response->assertJson(['message' => 'Invalid API key.']); +}); + +test('returns 401 with wrong token', function () { + createApiToken(); + + $wrongToken = 'tp_'.Str::random(48); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$wrongToken, + ])->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnauthorized(); + $response->assertJson(['message' => 'Invalid API key.']); +}); + +test('returns 401 with expired token', function () { + $result = createApiToken(); + + $result['token']->update(['expires_at' => now()->subDay()]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnauthorized(); + $response->assertJson(['message' => 'API key has expired.']); +}); + +test('authenticates with valid token', function () { + $result = createApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertOk(); +}); + +test('updates last_used_at on successful auth', function () { + $this->freezeTime(); + + $result = createApiToken(); + + expect($result['token']->last_used_at)->toBeNull(); + + $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $result['token']->refresh(); + + expect($result['token']->last_used_at)->not->toBeNull(); + expect($result['token']->last_used_at->toDateTimeString())->toBe(now()->toDateTimeString()); +}); diff --git a/tests/Feature/Api/HashtagApiTest.php b/tests/Feature/Api/HashtagApiTest.php new file mode 100644 index 00000000..af2fffc5 --- /dev/null +++ b/tests/Feature/Api/HashtagApiTest.php @@ -0,0 +1,149 @@ +create(); + + $factoryOverrides = collect($overrides)->except('workspace')->toArray(); + + $apiToken = ApiToken::factory()->create(array_merge([ + 'workspace_id' => $workspace->id, + 'token_lookup' => substr($plainToken, 3, 16), + 'token_hash' => Hash::make($plainToken), + ], $factoryOverrides)); + + return [ + 'token' => $apiToken, + 'plain_token' => $plainToken, + 'workspace' => $workspace, + ]; +} + +test('list hashtags', function () { + $result = createHashtagApiToken(); + + WorkspaceHashtag::factory()->count(3)->create([ + 'workspace_id' => $result['workspace']->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->getJson( + route('api.hashtags.index'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertOk(); + $response->assertJsonCount(3); +}); + +test('create hashtag', function () { + $result = createHashtagApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->postJson( + route('api.hashtags.store'), + [ + 'name' => 'Marketing Tags', + 'hashtags' => '#marketing #growth #saas', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertCreated(); + $response->assertJsonPath('name', 'Marketing Tags'); + + expect($result['workspace']->hashtags()->count())->toBe(1); +}); + +test('create hashtag validation errors', function () { + $result = createHashtagApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->postJson( + route('api.hashtags.store'), + [], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnprocessable(); + $response->assertJsonValidationErrors(['name', 'hashtags']); +}); + +test('update hashtag', function () { + $result = createHashtagApiToken(); + + $hashtag = WorkspaceHashtag::factory()->create([ + 'workspace_id' => $result['workspace']->id, + 'name' => 'Old Name', + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->putJson( + route('api.hashtags.update', $hashtag), + [ + 'name' => 'Updated Name', + 'hashtags' => '#updated #tags', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertOk(); + $response->assertJsonPath('name', 'Updated Name'); +}); + +test('delete hashtag', function () { + $result = createHashtagApiToken(); + + $hashtag = WorkspaceHashtag::factory()->create([ + 'workspace_id' => $result['workspace']->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->deleteJson( + route('api.hashtags.destroy', $hashtag), + [], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertNoContent(); + + expect(WorkspaceHashtag::find($hashtag->id))->toBeNull(); +}); + +test('cannot access hashtags from another workspace', function () { + $result = createHashtagApiToken(); + + $otherWorkspace = Workspace::factory()->create(); + $hashtag = WorkspaceHashtag::factory()->create([ + 'workspace_id' => $otherWorkspace->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->putJson( + route('api.hashtags.update', $hashtag), + [ + 'name' => 'Hacked Name', + 'hashtags' => '#hacked', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertNotFound(); +}); diff --git a/tests/Feature/Api/LabelApiTest.php b/tests/Feature/Api/LabelApiTest.php new file mode 100644 index 00000000..985611b6 --- /dev/null +++ b/tests/Feature/Api/LabelApiTest.php @@ -0,0 +1,170 @@ +create(); + + $factoryOverrides = collect($overrides)->except('workspace')->toArray(); + + $apiToken = ApiToken::factory()->create(array_merge([ + 'workspace_id' => $workspace->id, + 'token_lookup' => substr($plainToken, 3, 16), + 'token_hash' => Hash::make($plainToken), + ], $factoryOverrides)); + + return [ + 'token' => $apiToken, + 'plain_token' => $plainToken, + 'workspace' => $workspace, + ]; +} + +test('list labels', function () { + $result = createLabelApiToken(); + + WorkspaceLabel::factory()->count(3)->create([ + 'workspace_id' => $result['workspace']->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->getJson( + route('api.labels.index'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertOk(); + $response->assertJsonCount(3); +}); + +test('create label', function () { + $result = createLabelApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->postJson( + route('api.labels.store'), + [ + 'name' => 'Marketing', + 'color' => '#FF0000', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertCreated(); + $response->assertJsonPath('name', 'Marketing'); + $response->assertJsonPath('color', '#FF0000'); + + expect($result['workspace']->labels()->count())->toBe(1); +}); + +test('create label validation errors', function () { + $result = createLabelApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->postJson( + route('api.labels.store'), + [], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnprocessable(); + $response->assertJsonValidationErrors(['name', 'color']); +}); + +test('create label validates color format', function () { + $result = createLabelApiToken(); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->postJson( + route('api.labels.store'), + [ + 'name' => 'Bad Color', + 'color' => 'not-a-color', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnprocessable(); + $response->assertJsonValidationErrors(['color']); +}); + +test('update label', function () { + $result = createLabelApiToken(); + + $label = WorkspaceLabel::factory()->create([ + 'workspace_id' => $result['workspace']->id, + 'name' => 'Old Name', + 'color' => '#000000', + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->putJson( + route('api.labels.update', $label), + [ + 'name' => 'Updated Name', + 'color' => '#FFFFFF', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertOk(); + $response->assertJsonPath('name', 'Updated Name'); + $response->assertJsonPath('color', '#FFFFFF'); +}); + +test('delete label', function () { + $result = createLabelApiToken(); + + $label = WorkspaceLabel::factory()->create([ + 'workspace_id' => $result['workspace']->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->deleteJson( + route('api.labels.destroy', $label), + [], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertNoContent(); + + expect(WorkspaceLabel::find($label->id))->toBeNull(); +}); + +test('cannot access labels from another workspace', function () { + $result = createLabelApiToken(); + + $otherWorkspace = Workspace::factory()->create(); + $label = WorkspaceLabel::factory()->create([ + 'workspace_id' => $otherWorkspace->id, + ]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->putJson( + route('api.labels.update', $label), + [ + 'name' => 'Hacked Name', + 'color' => '#FF0000', + ], + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertNotFound(); +}); diff --git a/tests/Feature/Api/WorkspaceApiTest.php b/tests/Feature/Api/WorkspaceApiTest.php new file mode 100644 index 00000000..13713638 --- /dev/null +++ b/tests/Feature/Api/WorkspaceApiTest.php @@ -0,0 +1,57 @@ +create(); + + $factoryOverrides = collect($overrides)->except('workspace')->toArray(); + + $apiToken = ApiToken::factory()->create(array_merge([ + 'workspace_id' => $workspace->id, + 'token_lookup' => substr($plainToken, 3, 16), + 'token_hash' => Hash::make($plainToken), + ], $factoryOverrides)); + + return [ + 'token' => $apiToken, + 'plain_token' => $plainToken, + 'workspace' => $workspace, + ]; +} + +test('show current workspace', function () { + $workspace = Workspace::factory()->create([ + 'name' => 'Test Workspace', + ]); + + $result = createWorkspaceApiToken(['workspace' => $workspace]); + + $response = $this->withHeaders([ + 'Authorization' => 'Bearer '.$result['plain_token'], + ])->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertOk(); + $response->assertJsonPath('name', 'Test Workspace'); +}); + +test('show workspace requires authentication', function () { + $response = $this->getJson( + route('api.workspace.show'), + ['HTTP_HOST' => 'api.trypost.test'] + ); + + $response->assertUnauthorized(); +}); From 039ed02b4228c6c893da26c2c23b7909ce67c18a Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sun, 29 Mar 2026 20:14:23 -0300 Subject: [PATCH 04/91] feat: rate limiting, cleanup duplicates, ApiKey app tests, bootstrap hardening - Add API rate limiting (60/min per workspace) in AppServiceProvider - Add throttle:api middleware to all API routes - Add rate limit exception rendering for JSON responses - Add middleware priority list (AuthenticateApiToken before ThrottleRequests) - Add ApiKeyControllerTest (6 tests for App dashboard CRUD) - Remove duplicate test files (Controllers/ dir duplicates) - Remove old controllers and routes/settings.php - Add routes/mcp.php placeholder - Add API Keys nav item to settings layout - Fix LazilyRefreshDatabase conflict in API tests - 698 tests passing --- app/Providers/AppServiceProvider.php | 15 +++ bootstrap/app.php | 22 +++- routes/api.php | 2 +- tests/Feature/ApiKeyControllerTest.php | 79 +++++++++++++ .../Controllers/BillingControllerTest.php | 92 --------------- .../Controllers/MediaControllerTest.php | 106 ------------------ .../Controllers/OnboardingControllerTest.php | 85 -------------- 7 files changed, 116 insertions(+), 285 deletions(-) create mode 100644 tests/Feature/ApiKeyControllerTest.php delete mode 100644 tests/Feature/Controllers/BillingControllerTest.php delete mode 100644 tests/Feature/Controllers/MediaControllerTest.php delete mode 100644 tests/Feature/Controllers/OnboardingControllerTest.php diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index b5ec5c07..7ba8431c 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -20,12 +20,15 @@ use Carbon\CarbonImmutable; use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Auth\Notifications\VerifyEmail; +use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Database\Eloquent\Relations\Relation; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Facades\Date; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Event; +use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\ServiceProvider; use Illuminate\Validation\Rules\Password; use Laravel\Cashier\Cashier; @@ -56,6 +59,7 @@ public function boot(): void { $this->configureDefaults(); $this->configureMorphMap(); + $this->configureRateLimiting(); $this->configureSocialite(); $this->configureStripeWebhooks(); @@ -81,6 +85,17 @@ protected function configureMorphMap(): void ]); } + protected function configureRateLimiting(): void + { + RateLimiter::for('api', function (Request $request) { + if ($this->app->environment('local')) { + return Limit::none(); + } + + return Limit::perMinute(60)->by($request->workspace?->id ?: $request->ip()); + }); + } + protected function configureStripeWebhooks(): void { Event::listen(WebhookReceived::class, StripeEventListener::class); diff --git a/bootstrap/app.php b/bootstrap/app.php index 964e9a96..94282876 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -8,6 +8,9 @@ use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets; +use Illuminate\Http\Request; +use Illuminate\Routing\Middleware\ThrottleRequests; +use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( @@ -37,7 +40,24 @@ $middleware->preventRequestForgery(except: [ 'stripe/*', ]); + + $middleware->prependToPriorityList( + ThrottleRequests::class, + AuthenticateApiToken::class, + ); }) ->withExceptions(function (Exceptions $exceptions): void { - // + $exceptions->renderable(function (TooManyRequestsHttpException $e, Request $request) { + if ($request->expectsJson()) { + $retryAfter = $e->getHeaders()['Retry-After'] ?? null; + $message = $retryAfter + ? "Rate limit exceeded. Please retry after {$retryAfter} seconds." + : 'Rate limit exceeded. Please try again later.'; + + return response()->json([ + 'name' => 'rate_limit_exceeded', + 'message' => $message, + ], 429)->withHeaders($e->getHeaders()); + } + }); })->create(); diff --git a/routes/api.php b/routes/api.php index 875a6564..cf63a43e 100644 --- a/routes/api.php +++ b/routes/api.php @@ -12,7 +12,7 @@ Route::group( [ 'domain' => 'api.'.parse_url(config('app.url'), PHP_URL_HOST), - 'middleware' => ['api.auth'], + 'middleware' => ['api.auth', 'throttle:api'], ], function () { // Posts diff --git a/tests/Feature/ApiKeyControllerTest.php b/tests/Feature/ApiKeyControllerTest.php new file mode 100644 index 00000000..b2216563 --- /dev/null +++ b/tests/Feature/ApiKeyControllerTest.php @@ -0,0 +1,79 @@ +user = User::factory()->create(['setup' => Setup::Completed]); + $this->workspace = Workspace::factory()->create(['user_id' => $this->user->id]); + $this->workspace->members()->attach($this->user->id, ['role' => 'owner']); + $this->user->update(['current_workspace_id' => $this->workspace->id]); + $this->user->refresh(); +}); + +it('shows api keys page', function () { + $token = ApiToken::factory()->create(['workspace_id' => $this->workspace->id]); + + $this->actingAs($this->user) + ->get(route('app.api-keys.index')) + ->assertOk() + ->assertInertia(fn ($page) => $page + ->component('settings/ApiKeys') + ->has('apiTokens', 1) + ); +}); + +it('creates an api key', function () { + $this->actingAs($this->user) + ->post(route('app.api-keys.store'), [ + 'name' => 'My API Key', + ]) + ->assertRedirect(); + + expect(ApiToken::where('workspace_id', $this->workspace->id)->count())->toBe(1); + + $token = ApiToken::where('workspace_id', $this->workspace->id)->first(); + expect($token->name)->toBe('My API Key'); + expect($token->status)->toBe('active'); +}); + +it('creates an api key with expiration', function () { + $this->actingAs($this->user) + ->post(route('app.api-keys.store'), [ + 'name' => 'Expiring Key', + 'expires_at' => now()->addDays(30)->format('Y-m-d'), + ]) + ->assertRedirect(); + + $token = ApiToken::where('workspace_id', $this->workspace->id)->first(); + expect($token->expires_at)->not->toBeNull(); +}); + +it('validates name is required', function () { + $this->actingAs($this->user) + ->post(route('app.api-keys.store'), []) + ->assertSessionHasErrors('name'); +}); + +it('deletes an api key', function () { + $token = ApiToken::factory()->create(['workspace_id' => $this->workspace->id]); + + $this->actingAs($this->user) + ->delete(route('app.api-keys.destroy', $token)) + ->assertRedirect(); + + expect(ApiToken::find($token->id))->toBeNull(); +}); + +it('cannot delete api key from another workspace', function () { + $otherWorkspace = Workspace::factory()->create(); + $token = ApiToken::factory()->create(['workspace_id' => $otherWorkspace->id]); + + $this->actingAs($this->user) + ->delete(route('app.api-keys.destroy', $token)) + ->assertNotFound(); +}); diff --git a/tests/Feature/Controllers/BillingControllerTest.php b/tests/Feature/Controllers/BillingControllerTest.php deleted file mode 100644 index 758ff111..00000000 --- a/tests/Feature/Controllers/BillingControllerTest.php +++ /dev/null @@ -1,92 +0,0 @@ -user = User::factory()->create([ - 'setup' => Setup::Completed, - ]); - $this->workspace = Workspace::factory()->create(['user_id' => $this->user->id]); - $this->user->update(['current_workspace_id' => $this->workspace->id]); -}); - -test('billing index shows subscription info for subscribed user', function () { - $this->user->subscriptions()->create([ - 'type' => 'default', - 'stripe_id' => 'sub_123', - 'stripe_status' => 'active', - 'stripe_price' => 'price_123', - 'quantity' => 2, - ]); - - $response = $this->actingAs($this->user)->get(route('app.billing.index')); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->component('billing/Index') - ->has('hasSubscription') - ->has('subscription') - ->has('workspacesCount') - ); -}); - -test('billing index shows info for user without subscription', function () { - $response = $this->actingAs($this->user)->get(route('app.billing.index')); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->component('billing/Index') - ->where('hasSubscription', false) - ); -}); - -test('billing index shows trial info when on trial', function () { - $this->user->subscriptions()->create([ - 'type' => 'default', - 'stripe_id' => 'sub_123', - 'stripe_status' => 'trialing', - 'stripe_price' => 'price_123', - 'quantity' => 1, - 'trial_ends_at' => now()->addDays(14), - ]); - - $response = $this->actingAs($this->user)->get(route('app.billing.index')); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->component('billing/Index') - ->where('onTrial', true) - ->has('trialEndsAt') - ); -}); - -test('processing page shows for user during checkout', function () { - $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'success'])); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->component('billing/Processing') - ->has('userId') - ->where('status', 'success') - ); -}); - -test('processing page shows cancelled status', function () { - $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'cancelled'])); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->where('status', 'cancelled') - ); -}); - -test('processing page defaults to processing status for invalid status', function () { - $response = $this->actingAs($this->user)->get(route('app.billing.processing', ['status' => 'invalid'])); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->where('status', 'processing') - ); -}); diff --git a/tests/Feature/Controllers/MediaControllerTest.php b/tests/Feature/Controllers/MediaControllerTest.php deleted file mode 100644 index 624b56ca..00000000 --- a/tests/Feature/Controllers/MediaControllerTest.php +++ /dev/null @@ -1,106 +0,0 @@ -user = User::factory()->create([ - 'setup' => Setup::Completed, - ]); - $this->user->subscriptions()->create([ - 'type' => 'default', - 'stripe_id' => 'sub_123', - 'stripe_status' => 'active', - 'stripe_price' => 'price_123', - 'quantity' => 1, - ]); - $this->workspace = Workspace::factory()->create(['user_id' => $this->user->id]); - $this->user->update(['current_workspace_id' => $this->workspace->id]); -}); - -test('user can upload media to workspace', function () { - $file = UploadedFile::fake()->image('logo.jpg', 100, 100); - - $response = $this->actingAs($this->user)->postJson(route('app.medias.store'), [ - 'media' => $file, - 'model' => 'workspace', - 'model_id' => $this->workspace->id, - 'collection' => 'logo', - ]); - - $response->assertSuccessful(); - $response->assertJsonStructure(['id', 'url', 'type', 'original_filename']); - expect(Media::count())->toBe(1); -}); - -test('user can delete media', function () { - $file = UploadedFile::fake()->image('logo.jpg', 100, 100); - $media = $this->workspace->addMedia($file, 'logo'); - - $response = $this->actingAs($this->user)->deleteJson(route('app.medias.destroy', [ - 'modelId' => $this->workspace->id, - 'media' => $media->id, - ])); - - $response->assertSuccessful(); - expect(Media::find($media->id))->toBeNull(); -}); - -test('user cannot delete media from different model', function () { - $file = UploadedFile::fake()->image('logo.jpg', 100, 100); - $media = $this->workspace->addMedia($file, 'logo'); - - $otherWorkspace = Workspace::factory()->create(); - - $response = $this->actingAs($this->user)->deleteJson(route('app.medias.destroy', [ - 'modelId' => $otherWorkspace->id, - 'media' => $media->id, - ])); - - $response->assertForbidden(); -}); - -test('user can duplicate media to another model', function () { - $file = UploadedFile::fake()->image('image.jpg', 100, 100); - $media = $this->workspace->addMedia($file, 'default'); - - $postPlatform = PostPlatform::factory()->create([ - 'social_account_id' => SocialAccount::factory()->linkedin()->create([ - 'workspace_id' => $this->workspace->id, - ])->id, - ]); - - $response = $this->actingAs($this->user)->postJson(route('app.medias.duplicate', ['media' => $media->id]), [ - 'targets' => [ - [ - 'model' => 'postPlatform', - 'model_id' => $postPlatform->id, - 'collection' => 'default', - ], - ], - ]); - - $response->assertSuccessful(); - expect(Media::count())->toBe(2); -}); - -test('media store fails with invalid model type', function () { - $file = UploadedFile::fake()->image('logo.jpg', 100, 100); - - $response = $this->actingAs($this->user)->postJson(route('app.medias.store'), [ - 'media' => $file, - 'model' => 'invalid', - 'model_id' => $this->workspace->id, - 'collection' => 'logo', - ]); - - $response->assertUnprocessable(); - $response->assertJsonValidationErrors('model'); -}); diff --git a/tests/Feature/Controllers/OnboardingControllerTest.php b/tests/Feature/Controllers/OnboardingControllerTest.php deleted file mode 100644 index ca7db7ed..00000000 --- a/tests/Feature/Controllers/OnboardingControllerTest.php +++ /dev/null @@ -1,85 +0,0 @@ -user = User::factory()->create([ - 'setup' => Setup::Role, - ]); -}); - -test('step1 shows persona selection', function () { - $response = $this->actingAs($this->user)->get(route('app.onboarding.step1')); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->component('onboarding/Step1') - ->has('personas') - ); -}); - -test('step1 can be stored with valid persona', function () { - $response = $this->actingAs($this->user)->post(route('app.onboarding.step1.store'), [ - 'persona' => Persona::Creator->value, - ]); - - $response->assertRedirect(route('app.onboarding.step2')); - expect($this->user->fresh()->persona)->toBe(Persona::Creator); - expect($this->user->fresh()->setup)->toBe(Setup::Connections); -}); - -test('step1 fails with invalid persona', function () { - $response = $this->actingAs($this->user)->post(route('app.onboarding.step1.store'), [ - 'persona' => 'invalid', - ]); - - $response->assertSessionHasErrors('persona'); -}); - -test('step2 shows platforms page', function () { - $this->user->update(['setup' => Setup::Connections]); - $workspace = Workspace::factory()->create(['user_id' => $this->user->id]); - $this->user->update(['current_workspace_id' => $workspace->id]); - - $response = $this->actingAs($this->user)->get(route('app.onboarding.step2')); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->component('onboarding/Step2') - ->has('platforms') - ->has('hasWorkspace') - ); -}); - -test('step2 shows without workspace', function () { - $this->user->update(['setup' => Setup::Connections]); - - $response = $this->actingAs($this->user)->get(route('app.onboarding.step2')); - - $response->assertSuccessful(); - $response->assertInertia(fn ($page) => $page - ->where('hasWorkspace', false) - ); -}); - -test('step2 store redirects to calendar in self hosted mode', function () { - config(['trypost.self_hosted' => true]); - $this->user->update(['setup' => Setup::Connections]); - - $response = $this->actingAs($this->user)->post(route('app.onboarding.step2.store')); - - $response->assertRedirect(route('app.calendar')); - expect($this->user->fresh()->setup)->toBe(Setup::Completed); -}); - -test('complete sets setup to completed', function () { - $this->user->update(['setup' => Setup::Subscription]); - - $response = $this->actingAs($this->user)->get(route('app.onboarding.complete')); - - $response->assertRedirect(route('app.calendar')); - expect($this->user->fresh()->setup)->toBe(Setup::Completed); -}); From fabce14aad45aa7ff5cbdb8e1675f6cd8271ac82 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sun, 29 Mar 2026 20:30:36 -0300 Subject: [PATCH 05/91] feat: implement MCP server with tools, Post API tests, auth middleware - Create TryPostServer MCP server with 17 tools: Post (List, Get, Create, Delete), Hashtag (List, Create, Update, Delete), Label (List, Create, Update, Delete), Workspace (Get), ApiKey (List, Create, Delete) - Create AuthenticateMcpToken middleware (logs in workspace owner) - Register mcp.auth middleware alias in bootstrap/app.php - Create routes/ai.php with mcp.trypost.test subdomain - Add PostApiTest with 6 tests (list, show, create, delete, isolation) - Fix PostApiTest assertions for pagination/resource wrapping - 704 tests passing, frontend build passing --- .../cashier-stripe-development/SKILL.md | 6 +- .claude/skills/configuring-horizon/SKILL.md | 6 +- .../skills/inertia-vue-development/SKILL.md | 213 +++++++++++++++-- .claude/skills/mcp-development/SKILL.md | 176 +++++--------- .claude/skills/pest-testing/SKILL.md | 8 +- .claude/skills/wayfinder-development/SKILL.md | 6 +- CLAUDE.md | 75 +++--- .../Middleware/Mcp/AuthenticateMcpToken.php | 53 +++++ app/Mcp/Servers/TryPostServer.php | 66 ++++++ app/Mcp/Tools/ApiKey/CreateApiKeyTool.php | 40 ++++ app/Mcp/Tools/ApiKey/DeleteApiKeyTool.php | 35 +++ app/Mcp/Tools/ApiKey/ListApiKeysTool.php | 24 ++ app/Mcp/Tools/Hashtag/CreateHashtagTool.php | 37 +++ app/Mcp/Tools/Hashtag/DeleteHashtagTool.php | 35 +++ app/Mcp/Tools/Hashtag/ListHashtagsTool.php | 24 ++ app/Mcp/Tools/Hashtag/UpdateHashtagTool.php | 43 ++++ app/Mcp/Tools/Label/CreateLabelTool.php | 37 +++ app/Mcp/Tools/Label/DeleteLabelTool.php | 35 +++ app/Mcp/Tools/Label/ListLabelsTool.php | 24 ++ app/Mcp/Tools/Label/UpdateLabelTool.php | 43 ++++ app/Mcp/Tools/Post/CreatePostTool.php | 33 +++ app/Mcp/Tools/Post/DeletePostTool.php | 35 +++ app/Mcp/Tools/Post/GetPostTool.php | 35 +++ app/Mcp/Tools/Post/ListPostsTool.php | 28 +++ app/Mcp/Tools/Workspace/GetWorkspaceTool.php | 22 ++ app/Providers/AppServiceProvider.php | 7 +- app/Providers/TelescopeServiceProvider.php | 65 ++++++ boost.json | 1 + bootstrap/app.php | 2 + bootstrap/providers.php | 2 + composer.json | 3 + composer.lock | 216 +++++++++++++++++- config/ai.php | 130 +++++++++++ config/telescope.php | 212 +++++++++++++++++ ...32520_create_agent_conversations_table.php | 50 ++++ ..._233024_create_telescope_entries_table.php | 70 ++++++ routes/{mcp.php => ai.php} | 5 +- stubs/agent-middleware.stub | 20 ++ stubs/agent.stub | 44 ++++ stubs/structured-agent.stub | 56 +++++ stubs/tool.stub | 37 +++ tests/Feature/Api/PostApiTest.php | 104 +++++++++ 42 files changed, 1962 insertions(+), 201 deletions(-) create mode 100644 app/Http/Middleware/Mcp/AuthenticateMcpToken.php create mode 100644 app/Mcp/Servers/TryPostServer.php create mode 100644 app/Mcp/Tools/ApiKey/CreateApiKeyTool.php create mode 100644 app/Mcp/Tools/ApiKey/DeleteApiKeyTool.php create mode 100644 app/Mcp/Tools/ApiKey/ListApiKeysTool.php create mode 100644 app/Mcp/Tools/Hashtag/CreateHashtagTool.php create mode 100644 app/Mcp/Tools/Hashtag/DeleteHashtagTool.php create mode 100644 app/Mcp/Tools/Hashtag/ListHashtagsTool.php create mode 100644 app/Mcp/Tools/Hashtag/UpdateHashtagTool.php create mode 100644 app/Mcp/Tools/Label/CreateLabelTool.php create mode 100644 app/Mcp/Tools/Label/DeleteLabelTool.php create mode 100644 app/Mcp/Tools/Label/ListLabelsTool.php create mode 100644 app/Mcp/Tools/Label/UpdateLabelTool.php create mode 100644 app/Mcp/Tools/Post/CreatePostTool.php create mode 100644 app/Mcp/Tools/Post/DeletePostTool.php create mode 100644 app/Mcp/Tools/Post/GetPostTool.php create mode 100644 app/Mcp/Tools/Post/ListPostsTool.php create mode 100644 app/Mcp/Tools/Workspace/GetWorkspaceTool.php create mode 100644 app/Providers/TelescopeServiceProvider.php create mode 100644 config/ai.php create mode 100644 config/telescope.php create mode 100644 database/migrations/2026_03_29_232520_create_agent_conversations_table.php create mode 100644 database/migrations/2026_03_29_233024_create_telescope_entries_table.php rename routes/{mcp.php => ai.php} (56%) create mode 100644 stubs/agent-middleware.stub create mode 100644 stubs/agent.stub create mode 100644 stubs/structured-agent.stub create mode 100644 stubs/tool.stub create mode 100644 tests/Feature/Api/PostApiTest.php diff --git a/.claude/skills/cashier-stripe-development/SKILL.md b/.claude/skills/cashier-stripe-development/SKILL.md index 355e8a92..3611b62e 100644 --- a/.claude/skills/cashier-stripe-development/SKILL.md +++ b/.claude/skills/cashier-stripe-development/SKILL.md @@ -33,9 +33,9 @@ ## Basic Usage ### Installation ```bash -php artisan vendor:publish --tag="cashier-migrations" -php artisan migrate -php artisan vendor:publish --tag="cashier-config" +vendor/bin/sail artisan vendor:publish --tag="cashier-migrations" +vendor/bin/sail artisan migrate +vendor/bin/sail artisan vendor:publish --tag="cashier-config" ``` ### Environment Variables diff --git a/.claude/skills/configuring-horizon/SKILL.md b/.claude/skills/configuring-horizon/SKILL.md index bed1e74c..112c0d13 100644 --- a/.claude/skills/configuring-horizon/SKILL.md +++ b/.claude/skills/configuring-horizon/SKILL.md @@ -24,7 +24,7 @@ ## Basic Usage ### Installation ```bash -php artisan horizon:install +vendor/bin/sail artisan horizon:install ``` ### Supervisor Configuration @@ -70,7 +70,7 @@ ### Dashboard Authorization ## Verification -1. Run `php artisan horizon` and visit `/horizon` +1. Run `vendor/bin/sail artisan horizon` and visit `/horizon` 2. Confirm dashboard access is restricted as expected 3. Check that metrics populate after scheduling `horizon:snapshot` @@ -81,5 +81,5 @@ ## Common Pitfalls - Always check `config/horizon.php` before making changes to understand the current supervisor and environment configuration. - The `environments` array overrides only the keys you specify. It merges into `defaults` and does not replace it. - The timeout chain must be ordered: job `timeout` less than supervisor `timeout` less than `retry_after`. The wrong order can cause jobs to be retried before Horizon finishes timing them out. -- The metrics dashboard stays blank until `horizon:snapshot` is scheduled. Running `php artisan horizon` alone does not populate metrics. +- The metrics dashboard stays blank until `horizon:snapshot` is scheduled. Running `vendor/bin/sail artisan horizon` alone does not populate metrics. - Always use `search-docs` for the latest Horizon documentation rather than relying on this skill alone. \ No newline at end of file diff --git a/.claude/skills/inertia-vue-development/SKILL.md b/.claude/skills/inertia-vue-development/SKILL.md index a0612246..c69fd98e 100644 --- a/.claude/skills/inertia-vue-development/SKILL.md +++ b/.claude/skills/inertia-vue-development/SKILL.md @@ -1,6 +1,6 @@ --- name: inertia-vue-development -description: "Develops Inertia.js v2 Vue client-side applications. Activates when creating Vue pages, forms, or navigation; using ,
, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions Vue with Inertia, Vue pages, Vue forms, or Vue navigation." +description: "Develops Inertia.js v3 Vue client-side applications. Activates when creating Vue pages, forms, or navigation; using , , useForm, useHttp, setLayoutProps, or router; working with deferred props, prefetching, optimistic updates, instant visits, or polling; or when user mentions Vue with Inertia, Vue pages, Vue forms, or Vue navigation." license: MIT metadata: author: laravel @@ -8,9 +8,19 @@ # Inertia Vue Development +## When to Apply + +Activate this skill when: + +- Creating or modifying Vue page components for Inertia +- Working with forms in Vue (using ``, `useForm`, or `useHttp`) +- Implementing client-side navigation with `` or `router` +- Using v3 features: deferred props, prefetching, optimistic updates, instant visits, layout props, HTTP requests, WhenVisible, InfiniteScroll, once props, flash data, or polling +- Building Vue-specific features with the Inertia protocol + ## Documentation -Use `search-docs` for detailed Inertia v2 Vue patterns and documentation. +Use `search-docs` for detailed Inertia v3 Vue patterns and documentation. ## Basic Usage @@ -20,8 +30,6 @@ ### Page Components Location ### Page Component Structure -Important: Vue components must have a single root element. - ```vue + + +``` + +### Optimistic Updates + +Apply data changes instantly before the server responds, with automatic rollback on failure: + + +```vue + +``` + +Optimistic updates also work with `useForm` and the `` component: + + +```vue + +``` + +### Instant Visits + +Navigate to a new page immediately without waiting for the server response. The target component renders right away with shared props, while page-specific props load in the background. + + +```vue + + + +``` + +### Layout Props + +Share dynamic data between pages and persistent layouts: + + +```vue + + + +``` + + +```vue + + + +``` ### Deferred Props @@ -358,42 +496,69 @@ ### Polling ``` -- `autoStart` (default `true`) — set to `false` to start polling manually via the returned `start()` function -- `keepAlive` (default `false`) — set to `true` to prevent throttling when the browser tab is inactive +- `autoStart` (default `true`) - set to `false` to start polling manually via the returned `start()` function +- `keepAlive` (default `false`) - set to `true` to prevent throttling when the browser tab is inactive -### WhenVisible (Infinite Scroll) +### WhenVisible -Load more data when user scrolls to a specific element: +Lazy-load a prop when an element scrolls into view. Useful for deferring expensive data that sits below the fold: - + ```vue + + +``` + +### InfiniteScroll + +Automatically load additional pages of paginated data as users scroll: + + +```vue + ``` +The server must use `Inertia::scroll()` to configure the paginated data. Use the `search-docs` tool with a query of `infinite scroll` for detailed guidance on buffers, manual loading, reverse mode, and custom trigger elements. + ## Server-Side Patterns Server-side patterns (Inertia::render, props, middleware) are covered in inertia-laravel guidelines. @@ -405,4 +570,6 @@ ## Common Pitfalls - Forgetting to add loading states (skeleton screens) when using deferred props - Not handling the `undefined` state of deferred props before data loads - Using `` without preventing default submission (use `` component or `@submit.prevent`) -- Forgetting to check if `` component is available in your Inertia version \ No newline at end of file +- Forgetting to check if `` component is available in your Inertia version +- Using `router.cancel()` instead of `router.cancelAll()` (v3 breaking change) +- Using `router.on('invalid', ...)` or `router.on('exception', ...)` instead of the renamed `httpException` and `networkError` events \ No newline at end of file diff --git a/.claude/skills/mcp-development/SKILL.md b/.claude/skills/mcp-development/SKILL.md index 71269844..fb38e649 100644 --- a/.claude/skills/mcp-development/SKILL.md +++ b/.claude/skills/mcp-development/SKILL.md @@ -8,148 +8,88 @@ # MCP Development -## Documentation First +## Documentation -**CRITICAL**: Always use `search-docs` BEFORE writing MCP code. The documentation is version-specific, comprehensive, and always up-to-date. +Use `search-docs` for detailed Laravel MCP patterns and documentation. - -```bash +## Basic Usage -# Example searches +Register MCP servers in `routes/ai.php`: -search-docs(['mcp tools', 'mcp resources', 'mcp validation']) -``` - -## Quick Reference - -### Artisan Commands - -Create MCP Primitives" -```bash -php artisan make:mcp-tool ToolName -php artisan make:mcp-resource ResourceName -php artisan make:mcp-prompt PromptName -php artisan make:mcp-server ServerName -``` - -### Basic Tool Implementation - - + +```php +use Laravel\Mcp\Facades\Mcp; + +Mcp::web(); +``` + +### Creating MCP Primitives + +Create MCP tools, resources, prompts, and servers using artisan commands: + +```bash +vendor/bin/sail artisan make:mcp-tool ToolName # Create a tool + +vendor/bin/sail artisan make:mcp-resource ResourceName # Create a resource + +vendor/bin/sail artisan make:mcp-prompt PromptName # Create a prompt + +vendor/bin/sail artisan make:mcp-server ServerName # Create a server + +``` + +After creating primitives, register them in your server's `$tools`, `$resources`, or `$prompts` properties. + +### Tools + + ```php -use Illuminate\Contracts\JsonSchema\JsonSchema; -use Laravel\Mcp\Request; -use Laravel\Mcp\Response; use Laravel\Mcp\Server\Tool; +use Laravel\Mcp\Server\Request; +use Laravel\Mcp\Server\Response; class MyTool extends Tool { - protected string $description = 'Tool description for LLM'; - - public function schema(JsonSchema $schema): array - { - return [ - 'param' => $schema->string()->required(), - ]; - } - public function handle(Request $request): Response { - return Response::text($request->get('param')); + return new Response(['result' => 'success']); } } ``` -### Basic Resource Implementation +### Registering Primitives in a Server - +Each MCP server must explicitly declare the tools, resources, and prompts it exposes. + + ```php -use Laravel\Mcp\Response; -use Laravel\Mcp\Server\Resource; +use Laravel\Mcp\Server; -class MyResource extends Resource +class AppServer extends Server { - protected string $description = 'Resource description'; - protected string $uri = 'file://path/to/resource'; - protected string $mimeType = 'text/markdown'; + protected array $tools = [ + \App\Mcp\Tools\MyTool::class, + ]; - public function handle(): Response - { - return Response::text($content); - } + protected array $resources = [ + \App\Mcp\Resources\MyResource::class, + ]; + + protected array $prompts = [ + \App\Mcp\Prompts\MyPrompt::class, + ]; } ``` -### Response Methods +## Verification - -```php -Response::text('Text content'); -Response::error('Error message'); -Response::structured(['key' => 'value']); -``` - -## Testing MCP Primitives - -Test tools, resources, and prompts directly on their server: - - -```php -// Test a tool -$response = MyServer::tool(MyTool::class, ['param' => 'value']); -$response->assertOk()->assertSee('Expected text'); - -// Test as authenticated user -$response = MyServer::actingAs($user)->tool(MyTool::class, [...]); - -// Available assertions -$response->assertOk(); -$response->assertSee('text'); -$response->assertHasErrors(); -$response->assertHasNoErrors(); -$response->assertName('tool-name'); -$response->assertSentNotification('event/type', ['data' => 'value']); -``` - -### MCP Inspector - -Test interactively using the inspector: - - -```bash -php artisan mcp:inspector mcp/my-server # Web server - -php artisan mcp:inspector my-server # Local server - -``` - -## Available Features - -The following features exist—**use `search-docs` for implementation details**: - -- **Tools**: `schema()`, validation, annotations (`#[IsReadOnly]`, `#[IsDestructive]`, etc.) -- **Resources**: URI templates (`HasUriTemplate`), Dynamic resources -- **Prompts**: Arguments, multi-message responses -- **All primitives**: Dependency injection, `shouldRegister()`, validation -- **Responses**: Text, error, structured, streaming, metadata -- **Server registration**: Web routes, local routes, OAuth - -## Critical Imports - - -```php -use Laravel\Mcp\Request; // NOT Laravel\Mcp\Server\Request -use Laravel\Mcp\Response; // NOT Laravel\Mcp\Server\Response -use Laravel\Mcp\Server\Tool; -use Laravel\Mcp\Server\Resource; -use Laravel\Mcp\Server\Prompt; -use Illuminate\Contracts\JsonSchema\JsonSchema; -``` +1. Check `routes/ai.php` for proper registration +2. Test tool via MCP client ## Common Pitfalls -- **Not using `search-docs` before implementation** -- Wrong imports: `Laravel\Mcp\Server\Request` (wrong) vs `Laravel\Mcp\Request` (correct) -- Forgetting `schema()` method for tools with parameters -- Missing required properties: `$description`, `$uri`, `$mimeType` -- Wrong response pattern: `new Response()` instead of `Response::text()` -- Running `mcp:start` command locally (hangs waiting for stdin) \ No newline at end of file +- Running `mcp:start` command (it hangs waiting for input) +- Using HTTPS locally with Node-based MCP clients +- Not using `search-docs` for the latest MCP documentation +- Not registering MCP server routes in `routes/ai.php` +- Do not register `ai.php` in `bootstrap.php`; it is registered automatically. \ No newline at end of file diff --git a/.claude/skills/pest-testing/SKILL.md b/.claude/skills/pest-testing/SKILL.md index ba774e71..dc6f5d17 100644 --- a/.claude/skills/pest-testing/SKILL.md +++ b/.claude/skills/pest-testing/SKILL.md @@ -16,7 +16,7 @@ ## Basic Usage ### Creating Tests -All tests must be written using Pest. Use `php artisan make:test --pest {name}`. +All tests must be written using Pest. Use `vendor/bin/sail artisan make:test --pest {name}`. ### Test Organization @@ -35,9 +35,9 @@ ### Basic Test Structure ### Running Tests -- Run minimal tests with filter before finalizing: `php artisan test --compact --filter=testName`. -- Run all tests: `php artisan test --compact`. -- Run file: `php artisan test --compact tests/Feature/ExampleTest.php`. +- Run minimal tests with filter before finalizing: `vendor/bin/sail artisan test --compact --filter=testName`. +- Run all tests: `vendor/bin/sail artisan test --compact`. +- Run file: `vendor/bin/sail artisan test --compact tests/Feature/ExampleTest.php`. ## Assertions diff --git a/.claude/skills/wayfinder-development/SKILL.md b/.claude/skills/wayfinder-development/SKILL.md index 0b306459..451995db 100644 --- a/.claude/skills/wayfinder-development/SKILL.md +++ b/.claude/skills/wayfinder-development/SKILL.md @@ -18,11 +18,11 @@ ### Generate Routes Run after route changes if Vite plugin isn't installed: ```bash -php artisan wayfinder:generate --no-interaction +vendor/bin/sail artisan wayfinder:generate --no-interaction ``` For form helpers, use `--with-form` flag: ```bash -php artisan wayfinder:generate --with-form --no-interaction +vendor/bin/sail artisan wayfinder:generate --with-form --no-interaction ``` ### Import Patterns @@ -69,7 +69,7 @@ ## Wayfinder + Inertia ## Verification -1. Run `php artisan wayfinder:generate` to regenerate routes if Vite plugin isn't installed +1. Run `vendor/bin/sail artisan wayfinder:generate` to regenerate routes if Vite plugin isn't installed 2. Check TypeScript imports resolve correctly 3. Verify route URLs match expected paths diff --git a/CLAUDE.md b/CLAUDE.md index e8113c85..50ebbb7e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,24 +12,23 @@ ## Foundational Context - php - 8.4 - inertiajs/inertia-laravel (INERTIA_LARAVEL) - v3 - laravel/ai (AI) - v0 +- laravel/boost (BOOST) - v2 - laravel/cashier (CASHIER) - v16 - laravel/framework (LARAVEL) - v13 - laravel/horizon (HORIZON) - v5 - laravel/mcp (MCP) - v0 - laravel/nightwatch (NIGHTWATCH) - v1 -- laravel/pennant (PENNANT) - v1 - laravel/prompts (PROMPTS) - v0 - laravel/reverb (REVERB) - v1 - laravel/socialite (SOCIALITE) - v5 - laravel/wayfinder (WAYFINDER) - v0 -- laravel/boost (BOOST) - v2 - laravel/pail (PAIL) - v1 - laravel/pint (PINT) - v1 - laravel/sail (SAIL) - v1 - laravel/telescope (TELESCOPE) - v5 - pestphp/pest (PEST) - v4 - phpunit/phpunit (PHPUNIT) - v12 -- @inertiajs/vue3 (INERTIA_VUE) - v2 +- @inertiajs/vue3 (INERTIA_VUE) - v3 - tailwindcss (TAILWINDCSS) - v4 - vue (VUE) - v3 - @laravel/echo-vue (ECHO_VUE) - v2 @@ -45,15 +44,12 @@ ## Skills Activation - `cashier-stripe-development` — Handles Laravel Cashier Stripe integration including subscriptions, webhooks, Stripe Checkout, invoices, charges, refunds, trials, coupons, metered billing, and payment failure handling. Triggered when a user mentions Cashier, Billable, IncompletePayment, stripe_id, newSubscription, Stripe subscriptions, or billing. Also applies when setting up webhooks, handling SCA/3DS payment failures, testing with Stripe test cards, or troubleshooting incomplete subscriptions, CSRF webhook errors, or migration publish issues. - `laravel-best-practices` — Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns. - `configuring-horizon` — Use this skill whenever the user mentions Horizon by name in a Laravel context. Covers the full Horizon lifecycle: installing Horizon (horizon:install, Sail setup), configuring config/horizon.php (supervisor blocks, queue assignments, balancing strategies, minProcesses/maxProcesses), fixing the dashboard (authorization via Gate::define viewHorizon, blank metrics, horizon:snapshot scheduling), and troubleshooting production issues (worker crashes, timeout chain ordering, LongWaitDetected notifications, waits config). Also covers job tagging and silencing. Do not use for generic Laravel queues without Horizon, SQS or database drivers, standalone Redis setup, Linux supervisord, Telescope, or job batching. -- `mcp-development` — Use this skill for Laravel MCP development only. Trigger when creating or editing MCP tools, resources, prompts, or servers in Laravel projects. Covers: artisan make:mcp-\* generators, mcp:inspector, routes/ai.php, Tool/Resource/Prompt classes, schema validation, shouldRegister(), OAuth setup, URI templates, read-only attributes, and MCP debugging. Do not use for non-Laravel MCP projects or generic AI features without MCP. -- `pennant-development` — Use when working with Laravel Pennant the official Laravel feature flag package. Trigger whenever the query mentions Pennant by name or involves feature flags or feature toggles in a Laravel project. Tasks include defining feature flags checking whether features are active creating class based features in `app/Features` using Blade `@feature` directives scoping flags to users or teams building custom Pennant storage drivers protecting routes with feature flags testing feature flags with Pest or PHPUnit and implementing A B testing or gradual rollouts with feature flags. Do not trigger for generic Laravel configuration authorization policies authentication or non Pennant feature management systems. +- `mcp-development` — Use this skill for Laravel MCP development only. Trigger when creating or editing MCP tools, resources, prompts, or servers in Laravel projects. Covers: artisan make:mcp-* generators, mcp:inspector, routes/ai.php, Tool/Resource/Prompt classes, schema validation, shouldRegister(), OAuth setup, URI templates, read-only attributes, and MCP debugging. Do not use for non-Laravel MCP projects or generic AI features without MCP. - `socialite-development` — Manages OAuth social authentication with Laravel Socialite. Activate when adding social login providers; configuring OAuth redirect/callback flows; retrieving authenticated user details; customizing scopes or parameters; setting up community providers; testing with Socialite fakes; or when the user mentions social login, OAuth, Socialite, or third-party authentication. - `wayfinder-development` — Use this skill for Laravel Wayfinder which auto-generates typed functions for Laravel controllers and routes. ALWAYS use this skill when frontend code needs to call backend routes or controller actions. Trigger when: connecting any React/Vue/Svelte/Inertia frontend to Laravel controllers, routes, building end-to-end features with both frontend and backend, wiring up forms or links to backend endpoints, fixing route-related TypeScript errors, importing from @/actions or @/routes, or running wayfinder:generate. Use Wayfinder route functions instead of hardcoded URLs. Covers: wayfinder() vite plugin, .url()/.get()/.post()/.form(), query params, route model binding, tree-shaking. Do not use for backend-only task - `pest-testing` — Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code. -- `inertia-vue-development` — Develops Inertia.js v2 Vue client-side applications. Activates when creating Vue pages, forms, or navigation; using , , useForm, or router; working with deferred props, prefetching, or polling; or when user mentions Vue with Inertia, Vue pages, Vue forms, or Vue navigation. +- `inertia-vue-development` — Develops Inertia.js v3 Vue client-side applications. Activates when creating Vue pages, forms, or navigation; using , , useForm, useHttp, setLayoutProps, or router; working with deferred props, prefetching, optimistic updates, instant visits, or polling; or when user mentions Vue with Inertia, Vue pages, Vue forms, or Vue navigation. - `tailwindcss-development` — Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex/grid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3/v4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML/CSS component, CSS file audits, build tool configuration, and vanilla CSS. -- `ai-sdk-development` — Builds AI agents, generates text and chat responses, produces images, synthesizes audio, transcribes speech, generates vector embeddings, reranks documents, and manages files and vector stores using the Laravel AI SDK (laravel/ai). Supports structured output, streaming, tools, conversation memory, middleware, queueing, broadcasting, and provider failover. Use when building, editing, updating, debugging, or testing any AI functionality, including agents, LLMs, chatbots, text generation, image generation, audio, transcription, embeddings, RAG, similarity search, vector stores, prompting, structured output, or any AI provider (OpenAI, Anthropic, Gemini, Cohere, Groq, xAI, ElevenLabs, Jina, OpenRouter). -- `medialibrary-development` — Build and work with spatie/laravel-medialibrary features including associating files with Eloquent models, defining media collections and conversions, generating responsive images, and retrieving media URLs and paths. ## Conventions @@ -72,7 +68,7 @@ ## Application Structure & Architecture ## Frontend Bundling -- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them. +- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `vendor/bin/sail npm run build`, `vendor/bin/sail npm run dev`, or `vendor/bin/sail composer run dev`. Ask them. ## Documentation Files @@ -110,22 +106,21 @@ ### Search Syntax ## Artisan -- Run Artisan commands directly via the command line (e.g., `php artisan route:list`). Use `php artisan list` to discover available commands and `php artisan [command] --help` to check parameters. -- Inspect routes with `php artisan route:list`. Filter with: `--method=GET`, `--name=users`, `--path=api`, `--except-vendor`, `--only-vendor`. -- Read configuration values using dot notation: `php artisan config:show app.name`, `php artisan config:show database.default`. Or read config files directly from the `config/` directory. +- Run Artisan commands directly via the command line (e.g., `vendor/bin/sail artisan route:list`). Use `vendor/bin/sail artisan list` to discover available commands and `vendor/bin/sail artisan [command] --help` to check parameters. +- Inspect routes with `vendor/bin/sail artisan route:list`. Filter with: `--method=GET`, `--name=users`, `--path=api`, `--except-vendor`, `--only-vendor`. +- Read configuration values using dot notation: `vendor/bin/sail artisan config:show app.name`, `vendor/bin/sail artisan config:show database.default`. Or read config files directly from the `config/` directory. - To check environment variables, read the `.env` file directly. ## Tinker - Execute PHP in app context for debugging and testing code. Do not create models without user approval, prefer tests with factories instead. Prefer existing Artisan commands over custom tinker code. -- Always use single quotes to prevent shell expansion: `php artisan tinker --execute 'Your::code();'` - - Double quotes for PHP strings inside: `php artisan tinker --execute 'User::where("active", true)->count();'` +- Always use single quotes to prevent shell expansion: `vendor/bin/sail artisan tinker --execute 'Your::code();'` + - Double quotes for PHP strings inside: `vendor/bin/sail artisan tinker --execute 'User::where("active", true)->count();'` === php rules === # PHP -- Always declare `declare(strict_types=1);` at the top of every `.php` file. - Always use curly braces for control structures, even for single-line bodies. - Use PHP 8 constructor property promotion: `public function __construct(public GitHub $github) { }`. Do not leave empty zero-parameter `__construct()` methods unless the constructor is private. - Use explicit return type declarations and type hints for all method parameters: `function isAccessible(User $user, ?string $path = null): bool` @@ -133,19 +128,26 @@ # PHP - Prefer PHPDoc blocks over inline comments. Only add inline comments for exceptionally complex logic. - Use array shape type definitions in PHPDoc blocks. -=== herd rules === +=== sail rules === -# Laravel Herd +# Laravel Sail -- The application is served by Laravel Herd at `https?://[kebab-case-project-dir].test`. Use the `get-absolute-url` tool to generate valid URLs. Never run commands to serve the site. It is always available. -- Use the `herd` CLI to manage services, PHP versions, and sites (e.g. `herd sites`, `herd services:start `, `herd php:list`). Run `herd list` to discover all available commands. +- This project runs inside Laravel Sail's Docker containers. You MUST execute all commands through Sail. +- Start services using `vendor/bin/sail up -d` and stop them with `vendor/bin/sail stop`. +- Open the application in the browser by running `vendor/bin/sail open`. +- Always prefix PHP, Artisan, Composer, and Node commands with `vendor/bin/sail`. Examples: + - Run Artisan Commands: `vendor/bin/sail artisan migrate` + - Install Composer packages: `vendor/bin/sail composer install` + - Execute Node commands: `vendor/bin/sail npm run dev` + - Execute PHP scripts: `vendor/bin/sail php [script]` +- View all available Sail commands by running `vendor/bin/sail` without arguments. === tests rules === # Test Enforcement - Every change must be programmatically tested. Write a new test or update an existing test, then run the affected tests to make sure they pass. -- Run the minimum number of tests needed to ensure code quality and speed. Use `php artisan test --compact` with a specific filename or filter. +- Run the minimum number of tests needed to ensure code quality and speed. Use `vendor/bin/sail artisan test --compact` with a specific filename or filter. === inertia-laravel/core rules === @@ -174,13 +176,13 @@ # Inertia v3 # Do Things the Laravel Way -- Use `php artisan make:` commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands using `php artisan list` and check their parameters with `php artisan [command] --help`. -- If you're creating a generic PHP class, use `php artisan make:class`. +- Use `vendor/bin/sail artisan make:` commands to create new files (i.e. migrations, controllers, models, etc.). You can list available Artisan commands using `vendor/bin/sail artisan list` and check their parameters with `vendor/bin/sail artisan [command] --help`. +- If you're creating a generic PHP class, use `vendor/bin/sail artisan make:class`. - Pass `--no-interaction` to all Artisan commands to ensure they work without user input. You should also pass the correct `--options` to ensure correct behavior. ### Model Creation -- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `php artisan make:model --help` to check the available options. +- When creating new models, create useful factories and seeders for them too. Ask the user if they need any other things, using `vendor/bin/sail artisan make:model --help` to check the available options. ## APIs & Eloquent Resources @@ -194,11 +196,11 @@ ## Testing - When creating models for tests, use the factories for the models. Check if the factory has custom states that can be used before manually setting up the model. - Faker: Use methods such as `$this->faker->word()` or `fake()->randomDigit()`. Follow existing conventions whether to use `$this->faker` or `fake()`. -- When creating tests, make use of `php artisan make:test [options] {name}` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. +- When creating tests, make use of `vendor/bin/sail artisan make:test [options] {name}` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests. ## Vite Error -- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `npm run build` or ask the user to run `npm run dev` or `composer run dev`. +- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `vendor/bin/sail npm run build` or ask the user to run `vendor/bin/sail npm run dev` or `vendor/bin/sail composer run dev`. === wayfinder/core rules === @@ -210,15 +212,15 @@ # Laravel Wayfinder # Laravel Pint Code Formatter -- If you have modified any PHP files, you must run `vendor/bin/pint --dirty --format agent` before finalizing changes to ensure your code matches the project's expected style. -- Do not run `vendor/bin/pint --test --format agent`, simply run `vendor/bin/pint --format agent` to fix any formatting issues. +- If you have modified any PHP files, you must run `vendor/bin/sail bin pint --dirty --format agent` before finalizing changes to ensure your code matches the project's expected style. +- Do not run `vendor/bin/sail bin pint --test --format agent`, simply run `vendor/bin/sail bin pint --format agent` to fix any formatting issues. === pest/core rules === ## Pest -- This project uses Pest for testing. Create tests: `php artisan make:test --pest {name}`. -- Run tests: `php artisan test --compact` or filter: `php artisan test --compact --filter=testName`. +- This project uses Pest for testing. Create tests: `vendor/bin/sail artisan make:test --pest {name}`. +- Run tests: `vendor/bin/sail artisan test --compact` or filter: `vendor/bin/sail artisan test --compact --filter=testName`. - Do NOT delete tests without approval. === inertia-vue/core rules === @@ -226,23 +228,8 @@ ## Pest # Inertia + Vue Vue components must have a single root element. - - IMPORTANT: Activate `inertia-vue-development` when working with Inertia Vue client-side patterns. -=== laravel/ai rules === - -## Laravel AI SDK - -- This application uses the Laravel AI SDK (`laravel/ai`) for all AI functionality. -- Activate the `developing-with-ai-sdk` skill when building, editing, updating, debugging, or testing AI agents, text generation, chat, streaming, structured output, tools, image generation, audio, transcription, embeddings, reranking, vector stores, files, conversation memory, or any AI provider integration (OpenAI, Anthropic, Gemini, Cohere, Groq, xAI, ElevenLabs, Jina, OpenRouter). - -=== spatie/laravel-medialibrary rules === - -## Media Library - -- `spatie/laravel-medialibrary` associates files with Eloquent models, with support for collections, conversions, and responsive images. -- Always activate the `medialibrary-development` skill when working with media uploads, conversions, collections, responsive images, or any code that uses the `HasMedia` interface or `InteractsWithMedia` trait. - # Project-Specific Rules diff --git a/app/Http/Middleware/Mcp/AuthenticateMcpToken.php b/app/Http/Middleware/Mcp/AuthenticateMcpToken.php new file mode 100644 index 00000000..937d9bea --- /dev/null +++ b/app/Http/Middleware/Mcp/AuthenticateMcpToken.php @@ -0,0 +1,53 @@ +bearerToken(); + + if (! $token) { + return response()->json(['message' => 'Missing API key.'], Response::HTTP_UNAUTHORIZED); + } + + if (! str_starts_with($token, 'tp_') || strlen($token) !== 51) { + return response()->json(['message' => 'Invalid API key.'], Response::HTTP_UNAUTHORIZED); + } + + $lookup = substr($token, 3, 16); + $apiToken = ApiToken::where('token_lookup', $lookup)->first(); + + if (! $apiToken || ! Hash::check($token, $apiToken->token_hash)) { + return response()->json(['message' => 'Invalid API key.'], Response::HTTP_UNAUTHORIZED); + } + + if ($apiToken->status === 'expired') { + return response()->json(['message' => 'API key has expired.'], Response::HTTP_UNAUTHORIZED); + } + + $apiToken->update(['last_used_at' => now()]); + + $workspace = $apiToken->workspace; + $user = $workspace->owner; + + if (! $user) { + return response()->json(['message' => 'No workspace owner found.'], Response::HTTP_UNAUTHORIZED); + } + + $user->current_workspace_id = $workspace->id; + Auth::login($user); + + return $next($request); + } +} diff --git a/app/Mcp/Servers/TryPostServer.php b/app/Mcp/Servers/TryPostServer.php new file mode 100644 index 00000000..f0d2279c --- /dev/null +++ b/app/Mcp/Servers/TryPostServer.php @@ -0,0 +1,66 @@ +validate([ + 'name' => ['required', 'string', 'max:255'], + 'expires_at' => ['nullable', 'date', 'after:now'], + ]); + + $result = CreateApiKey::execute($request->user()->currentWorkspace, $validated); + + return Response::structured([ + ...$result['token']->toArray(), + 'token' => $result['plain_token'], + ]); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'name' => $schema->string()->required()->description('The API key name.'), + 'expires_at' => $schema->string()->description('Optional expiration date.'), + ]; + } +} diff --git a/app/Mcp/Tools/ApiKey/DeleteApiKeyTool.php b/app/Mcp/Tools/ApiKey/DeleteApiKeyTool.php new file mode 100644 index 00000000..58f4d062 --- /dev/null +++ b/app/Mcp/Tools/ApiKey/DeleteApiKeyTool.php @@ -0,0 +1,35 @@ +user()->current_workspace_id) + ->findOrFail(data_get($request->validated(), 'api_key_id')); + + DeleteApiKey::execute($apiToken); + + return Response::structured(['deleted' => true]); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'api_key_id' => $schema->string()->required()->description('The API key ID to delete.'), + ]; + } +} diff --git a/app/Mcp/Tools/ApiKey/ListApiKeysTool.php b/app/Mcp/Tools/ApiKey/ListApiKeysTool.php new file mode 100644 index 00000000..6ff34d85 --- /dev/null +++ b/app/Mcp/Tools/ApiKey/ListApiKeysTool.php @@ -0,0 +1,24 @@ +user()->currentWorkspace->apiTokens()->latest()->get(); + + return Response::structured($tokens->toArray()); + } +} diff --git a/app/Mcp/Tools/Hashtag/CreateHashtagTool.php b/app/Mcp/Tools/Hashtag/CreateHashtagTool.php new file mode 100644 index 00000000..1aa36ba4 --- /dev/null +++ b/app/Mcp/Tools/Hashtag/CreateHashtagTool.php @@ -0,0 +1,37 @@ +validate([ + 'name' => ['required', 'string', 'max:255'], + 'hashtags' => ['required', 'string'], + ]); + + $hashtag = CreateHashtag::execute($request->user()->currentWorkspace, $validated); + + return Response::structured($hashtag->toArray()); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'name' => $schema->string()->required()->description('The hashtag group name.'), + 'hashtags' => $schema->string()->required()->description('The hashtags string (e.g. "#tech #ai #startup").'), + ]; + } +} diff --git a/app/Mcp/Tools/Hashtag/DeleteHashtagTool.php b/app/Mcp/Tools/Hashtag/DeleteHashtagTool.php new file mode 100644 index 00000000..5df1d979 --- /dev/null +++ b/app/Mcp/Tools/Hashtag/DeleteHashtagTool.php @@ -0,0 +1,35 @@ +user()->current_workspace_id) + ->findOrFail(data_get($request->validated(), 'hashtag_id')); + + DeleteHashtag::execute($hashtag); + + return Response::structured(['deleted' => true]); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'hashtag_id' => $schema->string()->required()->description('The hashtag group ID to delete.'), + ]; + } +} diff --git a/app/Mcp/Tools/Hashtag/ListHashtagsTool.php b/app/Mcp/Tools/Hashtag/ListHashtagsTool.php new file mode 100644 index 00000000..2a830593 --- /dev/null +++ b/app/Mcp/Tools/Hashtag/ListHashtagsTool.php @@ -0,0 +1,24 @@ +user()->currentWorkspace->hashtags()->latest()->get(); + + return Response::structured($hashtags->toArray()); + } +} diff --git a/app/Mcp/Tools/Hashtag/UpdateHashtagTool.php b/app/Mcp/Tools/Hashtag/UpdateHashtagTool.php new file mode 100644 index 00000000..0bbc1aa2 --- /dev/null +++ b/app/Mcp/Tools/Hashtag/UpdateHashtagTool.php @@ -0,0 +1,43 @@ +validate([ + 'hashtag_id' => ['required', 'string'], + 'name' => ['required', 'string', 'max:255'], + 'hashtags' => ['required', 'string'], + ]); + + $hashtag = WorkspaceHashtag::where('workspace_id', $request->user()->current_workspace_id) + ->findOrFail(data_get($validated, 'hashtag_id')); + + $hashtag = UpdateHashtag::execute($hashtag, $validated); + + return Response::structured($hashtag->toArray()); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'hashtag_id' => $schema->string()->required()->description('The hashtag group ID.'), + 'name' => $schema->string()->required()->description('The new name.'), + 'hashtags' => $schema->string()->required()->description('The new hashtags string.'), + ]; + } +} diff --git a/app/Mcp/Tools/Label/CreateLabelTool.php b/app/Mcp/Tools/Label/CreateLabelTool.php new file mode 100644 index 00000000..05d42828 --- /dev/null +++ b/app/Mcp/Tools/Label/CreateLabelTool.php @@ -0,0 +1,37 @@ +validate([ + 'name' => ['required', 'string', 'max:255'], + 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], + ]); + + $label = CreateLabel::execute($request->user()->currentWorkspace, $validated); + + return Response::structured($label->toArray()); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'name' => $schema->string()->required()->description('The label name.'), + 'color' => $schema->string()->required()->description('Hex color code (e.g. #FF5733).'), + ]; + } +} diff --git a/app/Mcp/Tools/Label/DeleteLabelTool.php b/app/Mcp/Tools/Label/DeleteLabelTool.php new file mode 100644 index 00000000..29f42511 --- /dev/null +++ b/app/Mcp/Tools/Label/DeleteLabelTool.php @@ -0,0 +1,35 @@ +user()->current_workspace_id) + ->findOrFail(data_get($request->validated(), 'label_id')); + + DeleteLabel::execute($label); + + return Response::structured(['deleted' => true]); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'label_id' => $schema->string()->required()->description('The label ID to delete.'), + ]; + } +} diff --git a/app/Mcp/Tools/Label/ListLabelsTool.php b/app/Mcp/Tools/Label/ListLabelsTool.php new file mode 100644 index 00000000..f0ccb8cc --- /dev/null +++ b/app/Mcp/Tools/Label/ListLabelsTool.php @@ -0,0 +1,24 @@ +user()->currentWorkspace->labels()->latest()->get(); + + return Response::structured($labels->toArray()); + } +} diff --git a/app/Mcp/Tools/Label/UpdateLabelTool.php b/app/Mcp/Tools/Label/UpdateLabelTool.php new file mode 100644 index 00000000..f2be4ff4 --- /dev/null +++ b/app/Mcp/Tools/Label/UpdateLabelTool.php @@ -0,0 +1,43 @@ +validate([ + 'label_id' => ['required', 'string'], + 'name' => ['required', 'string', 'max:255'], + 'color' => ['required', 'string', 'max:7', 'regex:/^#[0-9A-Fa-f]{6}$/'], + ]); + + $label = WorkspaceLabel::where('workspace_id', $request->user()->current_workspace_id) + ->findOrFail(data_get($validated, 'label_id')); + + $label = UpdateLabel::execute($label, $validated); + + return Response::structured($label->toArray()); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'label_id' => $schema->string()->required()->description('The label ID.'), + 'name' => $schema->string()->required()->description('The new name.'), + 'color' => $schema->string()->required()->description('Hex color code (e.g. #FF5733).'), + ]; + } +} diff --git a/app/Mcp/Tools/Post/CreatePostTool.php b/app/Mcp/Tools/Post/CreatePostTool.php new file mode 100644 index 00000000..9261ae7a --- /dev/null +++ b/app/Mcp/Tools/Post/CreatePostTool.php @@ -0,0 +1,33 @@ +user()->currentWorkspace; + $post = CreatePost::execute($workspace, $request->user(), $request->validated()); + $post->load(['postPlatforms.socialAccount']); + + return Response::structured($post->toArray()); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'date' => $schema->string()->description('The scheduled date (Y-m-d). Defaults to today.'), + ]; + } +} diff --git a/app/Mcp/Tools/Post/DeletePostTool.php b/app/Mcp/Tools/Post/DeletePostTool.php new file mode 100644 index 00000000..923b7e2a --- /dev/null +++ b/app/Mcp/Tools/Post/DeletePostTool.php @@ -0,0 +1,35 @@ +user()->current_workspace_id) + ->findOrFail(data_get($request->validated(), 'post_id')); + + DeletePost::execute($post); + + return Response::structured(['deleted' => true]); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'post_id' => $schema->string()->required()->description('The post ID to delete.'), + ]; + } +} diff --git a/app/Mcp/Tools/Post/GetPostTool.php b/app/Mcp/Tools/Post/GetPostTool.php new file mode 100644 index 00000000..5868b04d --- /dev/null +++ b/app/Mcp/Tools/Post/GetPostTool.php @@ -0,0 +1,35 @@ +user()->current_workspace_id) + ->with(['postPlatforms.socialAccount', 'postPlatforms.media', 'labels']) + ->findOrFail(data_get($request->validated(), 'post_id')); + + return Response::structured($post->toArray()); + } + + public function schema(JsonSchema $schema): array + { + return [ + 'post_id' => $schema->string()->required()->description('The post ID to retrieve.'), + ]; + } +} diff --git a/app/Mcp/Tools/Post/ListPostsTool.php b/app/Mcp/Tools/Post/ListPostsTool.php new file mode 100644 index 00000000..fa4a9f3b --- /dev/null +++ b/app/Mcp/Tools/Post/ListPostsTool.php @@ -0,0 +1,28 @@ +user()->currentWorkspace + ->posts() + ->with(['postPlatforms.socialAccount', 'labels']) + ->latest('scheduled_at') + ->paginate(50); + + return Response::structured($posts->toArray()); + } +} diff --git a/app/Mcp/Tools/Workspace/GetWorkspaceTool.php b/app/Mcp/Tools/Workspace/GetWorkspaceTool.php new file mode 100644 index 00000000..994d5b67 --- /dev/null +++ b/app/Mcp/Tools/Workspace/GetWorkspaceTool.php @@ -0,0 +1,22 @@ +user()->currentWorkspace->toArray()); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 7ba8431c..1fde4800 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -21,6 +21,7 @@ use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Auth\Notifications\VerifyEmail; use Illuminate\Cache\RateLimiting\Limit; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; @@ -49,7 +50,10 @@ class AppServiceProvider extends ServiceProvider */ public function register(): void { - // + if ($this->app->environment('local') && class_exists(\Laravel\Telescope\TelescopeServiceProvider::class)) { + $this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class); + $this->app->register(TelescopeServiceProvider::class); + } } /** @@ -123,6 +127,7 @@ protected function configureDefaults(): void // Disable wrapping of JSON resources JsonResource::withoutWrapping(); + Model::shouldBeStrict(! $this->app->isProduction()); DB::prohibitDestructiveCommands( app()->isProduction(), diff --git a/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php new file mode 100644 index 00000000..4de2a6b2 --- /dev/null +++ b/app/Providers/TelescopeServiceProvider.php @@ -0,0 +1,65 @@ +hideSensitiveRequestDetails(); + + $isLocal = $this->app->environment('local'); + + Telescope::filter(function (IncomingEntry $entry) use ($isLocal) { + return $isLocal || + $entry->isReportableException() || + $entry->isFailedRequest() || + $entry->isFailedJob() || + $entry->isScheduledTask() || + $entry->hasMonitoredTag(); + }); + } + + /** + * Prevent sensitive request details from being logged by Telescope. + */ + protected function hideSensitiveRequestDetails(): void + { + if ($this->app->environment('local')) { + return; + } + + Telescope::hideRequestParameters(['_token']); + + Telescope::hideRequestHeaders([ + 'cookie', + 'x-csrf-token', + 'x-xsrf-token', + ]); + } + + /** + * Register the Telescope gate. + * + * This gate determines who can access Telescope in non-local environments. + */ + protected function gate(): void + { + Gate::define('viewTelescope', function (User $user) { + return in_array($user->email, [ + // + ]); + }); + } +} diff --git a/boost.json b/boost.json index 86a3c4ef..a48dd87f 100644 --- a/boost.json +++ b/boost.json @@ -10,6 +10,7 @@ "cashier-stripe-development", "laravel-best-practices", "configuring-horizon", + "mcp-development", "socialite-development", "wayfinder-development", "pest-testing", diff --git a/bootstrap/app.php b/bootstrap/app.php index 94282876..b0957dd7 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -4,6 +4,7 @@ use App\Http\Middleware\EnsureSubscribed; use App\Http\Middleware\HandleAppearance; use App\Http\Middleware\HandleInertiaRequests; +use App\Http\Middleware\Mcp\AuthenticateMcpToken; use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; @@ -35,6 +36,7 @@ $middleware->alias([ 'subscribed' => EnsureSubscribed::class, 'api.auth' => AuthenticateApiToken::class, + 'mcp.auth' => AuthenticateMcpToken::class, ]); $middleware->preventRequestForgery(except: [ diff --git a/bootstrap/providers.php b/bootstrap/providers.php index 2345aa62..5afbb957 100644 --- a/bootstrap/providers.php +++ b/bootstrap/providers.php @@ -2,8 +2,10 @@ use App\Providers\AppServiceProvider; use App\Providers\HorizonServiceProvider; +use App\Providers\TelescopeServiceProvider; return [ AppServiceProvider::class, HorizonServiceProvider::class, + TelescopeServiceProvider::class, ]; diff --git a/composer.json b/composer.json index a18b459e..1599fd75 100644 --- a/composer.json +++ b/composer.json @@ -35,10 +35,12 @@ "require": { "php": "^8.2", "inertiajs/inertia-laravel": "^3.0", + "laravel/ai": "^0.4.2", "laravel/boost": "^2.0", "laravel/cashier": "^16.2", "laravel/framework": "^13.0", "laravel/horizon": "^5.42", + "laravel/mcp": "^0.6.4", "laravel/nightwatch": "^1.22", "laravel/reverb": "^1.0", "laravel/socialite": "^5.24", @@ -59,6 +61,7 @@ "laravel/pail": "^1.2.2", "laravel/pint": "^1.24", "laravel/sail": "*", + "laravel/telescope": "^5.19", "mockery/mockery": "^1.6", "nunomaduro/collision": "^8.6", "pestphp/pest": "^4.4", diff --git a/composer.lock b/composer.lock index 562d52c5..174bd059 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "222ac114e81a021efda803dd571fb2d2", + "content-hash": "5408bdeb64bc5066a115e08ba7f378f3", "packages": [ { "name": "aws/aws-crt-php", @@ -1518,6 +1518,72 @@ }, "time": "2026-03-25T21:07:46+00:00" }, + { + "name": "laravel/ai", + "version": "v0.4.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/ai.git", + "reference": "91441b6ae5bc995f21bb3043744860bd3043e78c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/ai/zipball/91441b6ae5bc995f21bb3043744860bd3043e78c", + "reference": "91441b6ae5bc995f21bb3043744860bd3043e78c", + "shasum": "" + }, + "require": { + "illuminate/console": "^12.0|^13.0", + "illuminate/container": "^12.0|^13.0", + "illuminate/contracts": "^12.0|^13.0", + "illuminate/filesystem": "^12.0|^13.0", + "illuminate/json-schema": "^12.0|^13.0", + "illuminate/support": "^12.0|^13.0", + "laravel/prompts": "^0.3.6", + "laravel/serializable-closure": "^2.0", + "php": "^8.3", + "prism-php/prism": "^0.99.0" + }, + "require-dev": { + "laravel/pint": "^1.26", + "mockery/mockery": "^1.6.12", + "orchestra/testbench": "^10.6|^11.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Ai\\AiServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "files": [ + "functions.php" + ], + "psr-4": { + "Laravel\\Ai\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The official AI SDK for Laravel.", + "homepage": "https://github.com/laravel/ai", + "keywords": [ + "ai", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/ai/issues", + "source": "https://github.com/laravel/ai" + }, + "time": "2026-03-27T18:24:41+00:00" + }, { "name": "laravel/boost", "version": "v2.4.1", @@ -4531,6 +4597,85 @@ ], "time": "2026-03-09T20:33:04+00:00" }, + { + "name": "prism-php/prism", + "version": "v0.99.22", + "source": { + "type": "git", + "url": "https://github.com/prism-php/prism.git", + "reference": "989f67567aef69c613eae6e932d615fb96e2f5d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prism-php/prism/zipball/989f67567aef69c613eae6e932d615fb96e2f5d7", + "reference": "989f67567aef69c613eae6e932d615fb96e2f5d7", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "laravel/framework": "^11.0|^12.0|^13.0", + "php": "^8.2" + }, + "require-dev": { + "brianium/paratest": "^7.8.4", + "laravel/mcp": "^0.6.0", + "laravel/pint": "^1.14", + "mockery/mockery": "^1.6", + "orchestra/testbench": "^10", + "pestphp/pest": "^3.0", + "pestphp/pest-plugin-arch": "^3.0", + "pestphp/pest-plugin-laravel": "^3.0", + "phpstan/extension-installer": "^1.3", + "phpstan/phpdoc-parser": "^2.0", + "phpstan/phpstan": "2.1.34", + "phpstan/phpstan-deprecation-rules": "^2.0", + "projektgopher/whisky": "^0.7.0", + "rector/rector": "2.3.3", + "spatie/laravel-ray": "^1.39", + "symplify/rule-doc-generator-contracts": "^11.2" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "PrismServer": "Prism\\Prism\\Facades\\PrismServer" + }, + "providers": [ + "Prism\\Prism\\PrismServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Prism\\Prism\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "TJ Miller", + "email": "hello@echolabs.dev" + } + ], + "description": "A powerful Laravel package for integrating Large Language Models (LLMs) into your applications.", + "support": { + "issues": "https://github.com/prism-php/prism/issues", + "source": "https://github.com/prism-php/prism/tree/v0.99.22" + }, + "funding": [ + { + "url": "https://github.com/sixlive", + "type": "github" + } + ], + "time": "2026-03-12T17:55:23+00:00" + }, { "name": "psr/clock", "version": "1.0.0", @@ -9984,6 +10129,75 @@ }, "time": "2026-03-23T15:56:34+00:00" }, + { + "name": "laravel/telescope", + "version": "v5.19.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/telescope.git", + "reference": "5e95df170d14e03dd74c4b744969cf01f67a050b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/telescope/zipball/5e95df170d14e03dd74c4b744969cf01f67a050b", + "reference": "5e95df170d14e03dd74c4b744969cf01f67a050b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "laravel/framework": "^8.37|^9.0|^10.0|^11.0|^12.0|^13.0", + "laravel/sentinel": "^1.0", + "php": "^8.0", + "symfony/console": "^5.3|^6.0|^7.0|^8.0", + "symfony/var-dumper": "^5.0|^6.0|^7.0|^8.0" + }, + "require-dev": { + "ext-gd": "*", + "guzzlehttp/guzzle": "^6.0|^7.0", + "laravel/octane": "^1.4|^2.0", + "orchestra/testbench": "^6.47.1|^7.55|^8.36|^9.15|^10.8|^11.0", + "phpstan/phpstan": "^1.10" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Telescope\\TelescopeServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Telescope\\": "src/", + "Laravel\\Telescope\\Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Mohamed Said", + "email": "mohamed@laravel.com" + } + ], + "description": "An elegant debug assistant for the Laravel framework.", + "keywords": [ + "debugging", + "laravel", + "monitoring" + ], + "support": { + "issues": "https://github.com/laravel/telescope/issues", + "source": "https://github.com/laravel/telescope/tree/v5.19.0" + }, + "time": "2026-03-24T18:37:14+00:00" + }, { "name": "mockery/mockery", "version": "1.6.12", diff --git a/config/ai.php b/config/ai.php new file mode 100644 index 00000000..09ff5e07 --- /dev/null +++ b/config/ai.php @@ -0,0 +1,130 @@ + 'openai', + 'default_for_images' => 'gemini', + 'default_for_audio' => 'openai', + 'default_for_transcription' => 'openai', + 'default_for_embeddings' => 'openai', + 'default_for_reranking' => 'cohere', + + /* + |-------------------------------------------------------------------------- + | Caching + |-------------------------------------------------------------------------- + | + | Below you may configure caching strategies for AI related operations + | such as embedding generation. You are free to adjust these values + | based on your application's available caching stores and needs. + | + */ + + 'caching' => [ + 'embeddings' => [ + 'cache' => false, + 'store' => env('CACHE_STORE', 'database'), + ], + ], + + /* + |-------------------------------------------------------------------------- + | AI Providers + |-------------------------------------------------------------------------- + | + | Below are each of your AI providers defined for this application. Each + | represents an AI provider and API key combination which can be used + | to perform tasks like text, image, and audio creation via agents. + | + */ + + 'providers' => [ + 'anthropic' => [ + 'driver' => 'anthropic', + 'key' => env('ANTHROPIC_API_KEY'), + ], + + 'azure' => [ + 'driver' => 'azure', + 'key' => env('AZURE_OPENAI_API_KEY'), + 'url' => env('AZURE_OPENAI_URL'), + 'api_version' => env('AZURE_OPENAI_API_VERSION', '2024-10-21'), + 'deployment' => env('AZURE_OPENAI_DEPLOYMENT', 'gpt-4o'), + 'embedding_deployment' => env('AZURE_OPENAI_EMBEDDING_DEPLOYMENT', 'text-embedding-3-small'), + ], + + 'cohere' => [ + 'driver' => 'cohere', + 'key' => env('COHERE_API_KEY'), + ], + + 'deepseek' => [ + 'driver' => 'deepseek', + 'key' => env('DEEPSEEK_API_KEY'), + ], + + 'eleven' => [ + 'driver' => 'eleven', + 'key' => env('ELEVENLABS_API_KEY'), + ], + + 'gemini' => [ + 'driver' => 'gemini', + 'key' => env('GEMINI_API_KEY'), + ], + + 'groq' => [ + 'driver' => 'groq', + 'key' => env('GROQ_API_KEY'), + ], + + 'jina' => [ + 'driver' => 'jina', + 'key' => env('JINA_API_KEY'), + ], + + 'mistral' => [ + 'driver' => 'mistral', + 'key' => env('MISTRAL_API_KEY'), + ], + + 'ollama' => [ + 'driver' => 'ollama', + 'key' => env('OLLAMA_API_KEY', ''), + 'url' => env('OLLAMA_BASE_URL', 'http://localhost:11434'), + ], + + 'openai' => [ + 'driver' => 'openai', + 'key' => env('OPENAI_API_KEY'), + 'url' => env('OPENAI_URL', 'https://api.openai.com/v1'), + ], + + 'openrouter' => [ + 'driver' => 'openrouter', + 'key' => env('OPENROUTER_API_KEY'), + ], + + 'voyageai' => [ + 'driver' => 'voyageai', + 'key' => env('VOYAGEAI_API_KEY'), + ], + + 'xai' => [ + 'driver' => 'xai', + 'key' => env('XAI_API_KEY'), + ], + ], + +]; diff --git a/config/telescope.php b/config/telescope.php new file mode 100644 index 00000000..6250e787 --- /dev/null +++ b/config/telescope.php @@ -0,0 +1,212 @@ + env('TELESCOPE_ENABLED', true), + + /* + |-------------------------------------------------------------------------- + | Telescope Domain + |-------------------------------------------------------------------------- + | + | This is the subdomain where Telescope will be accessible from. If the + | setting is null, Telescope will reside under the same domain as the + | application. Otherwise, this value will be used as the subdomain. + | + */ + + 'domain' => env('TELESCOPE_DOMAIN'), + + /* + |-------------------------------------------------------------------------- + | Telescope Path + |-------------------------------------------------------------------------- + | + | This is the URI path where Telescope will be accessible from. Feel free + | to change this path to anything you like. Note that the URI will not + | affect the paths of its internal API that aren't exposed to users. + | + */ + + 'path' => env('TELESCOPE_PATH', 'telescope'), + + /* + |-------------------------------------------------------------------------- + | Telescope Storage Driver + |-------------------------------------------------------------------------- + | + | This configuration options determines the storage driver that will + | be used to store Telescope's data. In addition, you may set any + | custom options as needed by the particular driver you choose. + | + */ + + 'driver' => env('TELESCOPE_DRIVER', 'database'), + + 'storage' => [ + 'database' => [ + 'connection' => env('DB_CONNECTION', 'mysql'), + 'chunk' => 1000, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Telescope Queue + |-------------------------------------------------------------------------- + | + | This configuration options determines the queue connection and queue + | which will be used to process ProcessPendingUpdate jobs. This can + | be changed if you would prefer to use a non-default connection. + | + */ + + 'queue' => [ + 'connection' => env('TELESCOPE_QUEUE_CONNECTION'), + 'queue' => env('TELESCOPE_QUEUE'), + 'delay' => env('TELESCOPE_QUEUE_DELAY', 10), + ], + + /* + |-------------------------------------------------------------------------- + | Telescope Route Middleware + |-------------------------------------------------------------------------- + | + | These middleware will be assigned to every Telescope route, giving you + | the chance to add your own middleware to this list or change any of + | the existing middleware. Or, you can simply stick with this list. + | + */ + + 'middleware' => [ + 'web', + Authorize::class, + ], + + /* + |-------------------------------------------------------------------------- + | Allowed / Ignored Paths & Commands + |-------------------------------------------------------------------------- + | + | The following array lists the URI paths and Artisan commands that will + | not be watched by Telescope. In addition to this list, some Laravel + | commands, like migrations and queue commands, are always ignored. + | + */ + + 'only_paths' => [ + // 'api/*' + ], + + 'ignore_paths' => [ + 'livewire*', + 'nova-api*', + 'pulse*', + '_boost*', + '.well-known*', + ], + + 'ignore_commands' => [ + // + ], + + /* + |-------------------------------------------------------------------------- + | Telescope Watchers + |-------------------------------------------------------------------------- + | + | The following array lists the "watchers" that will be registered with + | Telescope. The watchers gather the application's profile data when + | a request or task is executed. Feel free to customize this list. + | + */ + + 'watchers' => [ + Watchers\BatchWatcher::class => env('TELESCOPE_BATCH_WATCHER', true), + + Watchers\CacheWatcher::class => [ + 'enabled' => env('TELESCOPE_CACHE_WATCHER', true), + 'hidden' => [], + 'ignore' => [], + ], + + Watchers\ClientRequestWatcher::class => [ + 'enabled' => env('TELESCOPE_CLIENT_REQUEST_WATCHER', true), + 'ignore_hosts' => [], + ], + + Watchers\CommandWatcher::class => [ + 'enabled' => env('TELESCOPE_COMMAND_WATCHER', true), + 'ignore' => [], + ], + + Watchers\DumpWatcher::class => [ + 'enabled' => env('TELESCOPE_DUMP_WATCHER', true), + 'always' => env('TELESCOPE_DUMP_WATCHER_ALWAYS', false), + ], + + Watchers\EventWatcher::class => [ + 'enabled' => env('TELESCOPE_EVENT_WATCHER', true), + 'ignore' => [], + ], + + Watchers\ExceptionWatcher::class => env('TELESCOPE_EXCEPTION_WATCHER', true), + + Watchers\GateWatcher::class => [ + 'enabled' => env('TELESCOPE_GATE_WATCHER', true), + 'ignore_abilities' => [], + 'ignore_packages' => true, + 'ignore_paths' => [], + ], + + Watchers\JobWatcher::class => env('TELESCOPE_JOB_WATCHER', true), + + Watchers\LogWatcher::class => [ + 'enabled' => env('TELESCOPE_LOG_WATCHER', true), + 'level' => 'error', + ], + + Watchers\MailWatcher::class => env('TELESCOPE_MAIL_WATCHER', true), + + Watchers\ModelWatcher::class => [ + 'enabled' => env('TELESCOPE_MODEL_WATCHER', true), + 'events' => ['eloquent.*'], + 'hydrations' => true, + ], + + Watchers\NotificationWatcher::class => env('TELESCOPE_NOTIFICATION_WATCHER', true), + + Watchers\QueryWatcher::class => [ + 'enabled' => env('TELESCOPE_QUERY_WATCHER', true), + 'ignore_packages' => true, + 'ignore_paths' => [], + 'slow' => 100, + ], + + Watchers\RedisWatcher::class => env('TELESCOPE_REDIS_WATCHER', true), + + Watchers\RequestWatcher::class => [ + 'enabled' => env('TELESCOPE_REQUEST_WATCHER', true), + 'size_limit' => env('TELESCOPE_RESPONSE_SIZE_LIMIT', 64), + 'ignore_http_methods' => [], + 'ignore_status_codes' => [], + ], + + Watchers\ScheduleWatcher::class => env('TELESCOPE_SCHEDULE_WATCHER', true), + Watchers\ViewWatcher::class => env('TELESCOPE_VIEW_WATCHER', true), + ], +]; diff --git a/database/migrations/2026_03_29_232520_create_agent_conversations_table.php b/database/migrations/2026_03_29_232520_create_agent_conversations_table.php new file mode 100644 index 00000000..9085f86d --- /dev/null +++ b/database/migrations/2026_03_29_232520_create_agent_conversations_table.php @@ -0,0 +1,50 @@ +uuid('id')->primary(); + $table->foreignId('user_id')->nullable(); + $table->string('title'); + $table->timestamps(); + + $table->index(['user_id', 'updated_at']); + }); + + Schema::create('agent_conversation_messages', function (Blueprint $table) { + $table->uuid('id')->primary(); + $table->string('conversation_id', 36)->index(); + $table->foreignId('user_id')->nullable(); + $table->string('agent'); + $table->string('role', 25); + $table->text('content'); + $table->text('attachments'); + $table->text('tool_calls'); + $table->text('tool_results'); + $table->text('usage'); + $table->text('meta'); + $table->timestamps(); + + $table->index(['conversation_id', 'user_id', 'updated_at'], 'conversation_index'); + $table->index(['user_id']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('agent_conversations'); + Schema::dropIfExists('agent_conversation_messages'); + } +}; diff --git a/database/migrations/2026_03_29_233024_create_telescope_entries_table.php b/database/migrations/2026_03_29_233024_create_telescope_entries_table.php new file mode 100644 index 00000000..031b6f47 --- /dev/null +++ b/database/migrations/2026_03_29_233024_create_telescope_entries_table.php @@ -0,0 +1,70 @@ +getConnection()); + + $schema->create('telescope_entries', function (Blueprint $table) { + $table->bigIncrements('sequence'); + $table->uuid('uuid'); + $table->uuid('batch_id'); + $table->string('family_hash')->nullable(); + $table->boolean('should_display_on_index')->default(true); + $table->string('type', 20); + $table->longText('content'); + $table->dateTime('created_at')->nullable(); + + $table->unique('uuid'); + $table->index('batch_id'); + $table->index('family_hash'); + $table->index('created_at'); + $table->index(['type', 'should_display_on_index']); + }); + + $schema->create('telescope_entries_tags', function (Blueprint $table) { + $table->uuid('entry_uuid'); + $table->string('tag'); + + $table->primary(['entry_uuid', 'tag']); + $table->index('tag'); + + $table->foreign('entry_uuid') + ->references('uuid') + ->on('telescope_entries') + ->cascadeOnDelete(); + }); + + $schema->create('telescope_monitoring', function (Blueprint $table) { + $table->string('tag')->primary(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + $schema = Schema::connection($this->getConnection()); + + $schema->dropIfExists('telescope_entries_tags'); + $schema->dropIfExists('telescope_entries'); + $schema->dropIfExists('telescope_monitoring'); + } +}; diff --git a/routes/mcp.php b/routes/ai.php similarity index 56% rename from routes/mcp.php rename to routes/ai.php index 92f6d3b7..79c70e99 100644 --- a/routes/mcp.php +++ b/routes/ai.php @@ -2,13 +2,16 @@ declare(strict_types=1); +use App\Mcp\Servers\TryPostServer; use Illuminate\Support\Facades\Route; +use Laravel\Mcp\Facades\Mcp; Route::group( [ 'domain' => 'mcp.'.parse_url(config('app.url'), PHP_URL_HOST), ], function () { - // + Mcp::web('/trypost', TryPostServer::class) + ->middleware('mcp.auth'); } ); diff --git a/stubs/agent-middleware.stub b/stubs/agent-middleware.stub new file mode 100644 index 00000000..c1a50f4f --- /dev/null +++ b/stubs/agent-middleware.stub @@ -0,0 +1,20 @@ +then(function (AgentResponse $response) { + // ... + }); + } +} diff --git a/stubs/agent.stub b/stubs/agent.stub new file mode 100644 index 00000000..06471d5d --- /dev/null +++ b/stubs/agent.stub @@ -0,0 +1,44 @@ + $schema->string()->required(), + ]; + } +} diff --git a/stubs/tool.stub b/stubs/tool.stub new file mode 100644 index 00000000..e0960219 --- /dev/null +++ b/stubs/tool.stub @@ -0,0 +1,37 @@ + $schema->string()->required(), + ]; + } +} diff --git a/tests/Feature/Api/PostApiTest.php b/tests/Feature/Api/PostApiTest.php new file mode 100644 index 00000000..26b6d55f --- /dev/null +++ b/tests/Feature/Api/PostApiTest.php @@ -0,0 +1,104 @@ +user = User::factory()->create(); + $this->workspace = Workspace::factory()->create(['user_id' => $this->user->id]); + $this->workspace->members()->attach($this->user->id, ['role' => 'owner']); + + $plainToken = 'tp_'.Str::random(48); + $this->plainToken = $plainToken; + $this->apiToken = ApiToken::factory()->create([ + 'workspace_id' => $this->workspace->id, + 'token_lookup' => substr($plainToken, 3, 16), + 'token_hash' => Hash::make($plainToken), + ]); + + $this->socialAccount = SocialAccount::factory()->create([ + 'workspace_id' => $this->workspace->id, + 'platform' => Platform::LinkedIn, + ]); +}); + +it('lists posts', function () { + $post = Post::factory()->create([ + 'workspace_id' => $this->workspace->id, + 'user_id' => $this->user->id, + ]); + + $this->withHeaders(['Authorization' => 'Bearer '.$this->plainToken]) + ->getJson(route('api.posts.index')) + ->assertOk() + ->assertJsonCount(1, 'data'); +}); + +it('shows a post', function () { + $post = Post::factory()->create([ + 'workspace_id' => $this->workspace->id, + 'user_id' => $this->user->id, + ]); + + $this->withHeaders(['Authorization' => 'Bearer '.$this->plainToken]) + ->getJson(route('api.posts.show', $post)) + ->assertOk() + ->assertJsonPath('id', $post->id); +}); + +it('cannot show post from another workspace', function () { + $otherWorkspace = Workspace::factory()->create(); + $post = Post::factory()->create([ + 'workspace_id' => $otherWorkspace->id, + 'user_id' => $this->user->id, + ]); + + $this->withHeaders(['Authorization' => 'Bearer '.$this->plainToken]) + ->getJson(route('api.posts.show', $post)) + ->assertNotFound(); +}); + +it('creates a post', function () { + $this->withHeaders(['Authorization' => 'Bearer '.$this->plainToken]) + ->postJson(route('api.posts.store'), [ + 'date' => now()->addDay()->format('Y-m-d'), + ]) + ->assertCreated() + ->assertJsonPath('status', PostStatus::Draft->value); + + expect(Post::where('workspace_id', $this->workspace->id)->count())->toBe(1); +}); + +it('deletes a post', function () { + $post = Post::factory()->create([ + 'workspace_id' => $this->workspace->id, + 'user_id' => $this->user->id, + ]); + + $this->withHeaders(['Authorization' => 'Bearer '.$this->plainToken]) + ->deleteJson(route('api.posts.destroy', $post)) + ->assertNoContent(); + + expect(Post::find($post->id))->toBeNull(); +}); + +it('cannot delete post from another workspace', function () { + $otherWorkspace = Workspace::factory()->create(); + $post = Post::factory()->create([ + 'workspace_id' => $otherWorkspace->id, + 'user_id' => $this->user->id, + ]); + + $this->withHeaders(['Authorization' => 'Bearer '.$this->plainToken]) + ->deleteJson(route('api.posts.destroy', $post)) + ->assertNotFound(); +}); From a926033d06108299316dea0e7ba1a38432b998f4 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sun, 29 Mar 2026 21:13:30 -0300 Subject: [PATCH 06/91] 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) --- app/Http/Controllers/App/MediaController.php | 4 +- app/Http/Controllers/App/PostController.php | 2 +- .../App/Settings/ProfileController.php | 4 +- .../Controllers/App/WorkspaceController.php | 4 +- .../App/WorkspaceInviteController.php | 2 +- .../Auth/AuthenticatedSessionController.php | 2 +- .../Middleware/{ => App}/EnsureSubscribed.php | 2 +- .../{ => App}/EnsureUserSetupIsComplete.php | 2 +- .../Middleware/{ => App}/HandleAppearance.php | 2 +- .../{ => App}/HandleInertiaRequests.php | 46 ++++-------- .../Requests/{ => App}/Auth/LoginRequest.php | 2 +- .../Invite}/StoreWorkspaceInviteRequest.php | 2 +- .../Media}/StoreChunkedMediaRequest.php | 2 +- .../{ => App/Media}/StoreMediaRequest.php | 2 +- .../{ => App/Post}/UpdatePostRequest.php | 2 +- .../Settings/PasswordUpdateRequest.php | 2 +- .../Settings/ProfileDeleteRequest.php | 2 +- .../Settings/ProfileUpdateRequest.php | 2 +- .../Workspace}/StoreWorkspaceRequest.php | 2 +- .../Workspace}/UpdateWorkspaceRequest.php | 2 +- .../Resources/Api/SocialAccountResource.php | 3 +- .../AuthUserResource.php | 26 +++++++ .../AuthWorkspaceResource.php | 45 ++++++++++++ bootstrap/app.php | 6 +- bootstrap/providers.php | 2 - composer.json | 4 +- config/telescope.php | 4 +- database/factories/UserFactory.php | 5 ++ resources/js/components/AppHeader.vue | 2 +- resources/js/components/AppSidebar.vue | 6 +- resources/js/components/WorkspaceSwitcher.vue | 4 +- resources/js/layouts/settings/Layout.vue | 2 +- routes/app.php | 2 +- routes/auth.php | 70 +++++++++++-------- 34 files changed, 169 insertions(+), 102 deletions(-) rename app/Http/Middleware/{ => App}/EnsureSubscribed.php (97%) rename app/Http/Middleware/{ => App}/EnsureUserSetupIsComplete.php (97%) rename app/Http/Middleware/{ => App}/HandleAppearance.php (93%) rename app/Http/Middleware/{ => App}/HandleInertiaRequests.php (51%) rename app/Http/Requests/{ => App}/Auth/LoginRequest.php (98%) rename app/Http/Requests/{ => App/Invite}/StoreWorkspaceInviteRequest.php (96%) rename app/Http/Requests/{ => App/Media}/StoreChunkedMediaRequest.php (98%) rename app/Http/Requests/{ => App/Media}/StoreMediaRequest.php (97%) rename app/Http/Requests/{ => App/Post}/UpdatePostRequest.php (95%) rename app/Http/Requests/{ => App}/Settings/PasswordUpdateRequest.php (93%) rename app/Http/Requests/{ => App}/Settings/ProfileDeleteRequest.php (91%) rename app/Http/Requests/{ => App}/Settings/ProfileUpdateRequest.php (91%) rename app/Http/Requests/{ => App/Workspace}/StoreWorkspaceRequest.php (92%) rename app/Http/Requests/{ => App/Workspace}/UpdateWorkspaceRequest.php (94%) create mode 100644 app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php create mode 100644 app/Http/Resources/App/HandleInertiaRequests/AuthWorkspaceResource.php diff --git a/app/Http/Controllers/App/MediaController.php b/app/Http/Controllers/App/MediaController.php index 398cbdb1..fac1e850 100644 --- a/app/Http/Controllers/App/MediaController.php +++ b/app/Http/Controllers/App/MediaController.php @@ -4,8 +4,8 @@ namespace App\Http\Controllers\App; -use App\Http\Requests\StoreChunkedMediaRequest; -use App\Http\Requests\StoreMediaRequest; +use App\Http\Requests\App\Media\StoreChunkedMediaRequest; +use App\Http\Requests\App\Media\StoreMediaRequest; use App\Models\Media; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; diff --git a/app/Http/Controllers/App/PostController.php b/app/Http/Controllers/App/PostController.php index cf2e8482..18f584dc 100644 --- a/app/Http/Controllers/App/PostController.php +++ b/app/Http/Controllers/App/PostController.php @@ -8,7 +8,7 @@ use App\Actions\Post\DeletePost; use App\Actions\Post\UpdatePost; use App\Enums\SocialAccount\Platform; -use App\Http\Requests\UpdatePostRequest; +use App\Http\Requests\App\Post\UpdatePostRequest; use App\Models\Post; use App\Services\Social\PinterestPublisher; use Carbon\Carbon; diff --git a/app/Http/Controllers/App/Settings/ProfileController.php b/app/Http/Controllers/App/Settings/ProfileController.php index 838c6f26..6f845551 100644 --- a/app/Http/Controllers/App/Settings/ProfileController.php +++ b/app/Http/Controllers/App/Settings/ProfileController.php @@ -6,8 +6,8 @@ use App\Enums\UserWorkspace\Role; use App\Http\Controllers\Controller; -use App\Http\Requests\Settings\ProfileDeleteRequest; -use App\Http\Requests\Settings\ProfileUpdateRequest; +use App\Http\Requests\App\Settings\ProfileDeleteRequest; +use App\Http\Requests\App\Settings\ProfileUpdateRequest; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/App/WorkspaceController.php b/app/Http/Controllers/App/WorkspaceController.php index d94d39dc..afe0691d 100644 --- a/app/Http/Controllers/App/WorkspaceController.php +++ b/app/Http/Controllers/App/WorkspaceController.php @@ -6,8 +6,8 @@ use App\Actions\Workspace\CreateWorkspace; use App\Actions\Workspace\DeleteWorkspace; -use App\Http\Requests\StoreWorkspaceRequest; -use App\Http\Requests\UpdateWorkspaceRequest; +use App\Http\Requests\App\Workspace\StoreWorkspaceRequest; +use App\Http\Requests\App\Workspace\UpdateWorkspaceRequest; use App\Models\Workspace; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/App/WorkspaceInviteController.php b/app/Http/Controllers/App/WorkspaceInviteController.php index 36ca8905..39068f01 100644 --- a/app/Http/Controllers/App/WorkspaceInviteController.php +++ b/app/Http/Controllers/App/WorkspaceInviteController.php @@ -8,7 +8,7 @@ use App\Actions\Invite\DeleteInvite; use App\Actions\Invite\RemoveMember; use App\Enums\UserWorkspace\Role as WorkspaceRole; -use App\Http\Requests\StoreWorkspaceInviteRequest; +use App\Http\Requests\App\Invite\StoreWorkspaceInviteRequest; use App\Models\WorkspaceInvite; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php index c3ce6dd6..6b77847d 100644 --- a/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ b/app/Http/Controllers/Auth/AuthenticatedSessionController.php @@ -5,7 +5,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; -use App\Http\Requests\Auth\LoginRequest; +use App\Http\Requests\App\Auth\LoginRequest; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; diff --git a/app/Http/Middleware/EnsureSubscribed.php b/app/Http/Middleware/App/EnsureSubscribed.php similarity index 97% rename from app/Http/Middleware/EnsureSubscribed.php rename to app/Http/Middleware/App/EnsureSubscribed.php index e5e5ec29..e1354a48 100644 --- a/app/Http/Middleware/EnsureSubscribed.php +++ b/app/Http/Middleware/App/EnsureSubscribed.php @@ -1,6 +1,6 @@ */ public function share(Request $request): array { $user = $request->user(); - if ($user) { + if ($user?->language) { App::setLocale($user->language->code); } $currentWorkspace = $user?->currentWorkspace; - $currentRole = null; - - if ($user && $currentWorkspace) { - $currentRole = $user->workspaces() - ->where('workspaces.id', $currentWorkspace->id) - ->first() - ?->pivot - ?->role; - } return [ ...parent::share($request), 'name' => config('app.name'), 'auth' => [ - 'user' => $user, - 'role' => $currentRole, + 'user' => $user ? AuthUserResource::make($user) : null, + 'currentWorkspace' => $currentWorkspace ? AuthWorkspaceResource::make($currentWorkspace, $user) : null, + 'workspaces' => $user + ? $user->workspaces()->get()->map(fn ($ws) => AuthWorkspaceResource::summary($ws)) + : [], ], - 'currentWorkspace' => $currentWorkspace, - 'workspaces' => $user ? $user->workspaces()->select('workspaces.id', 'workspaces.name')->get() : [], 'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true', 'flash' => $request->session()->get('flash', []), + 'applicationUrl' => config('app.url'), 'env' => config('app.env'), 'locale' => app()->getLocale(), + 'languages' => fn () => Cache::remember('languages:public', 3600, fn () => Language::query()->orderBy('name')->get()->toArray()), 'selfHosted' => config('trypost.self_hosted'), - 'languages' => Language::all(), ]; } } diff --git a/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/App/Auth/LoginRequest.php similarity index 98% rename from app/Http/Requests/Auth/LoginRequest.php rename to app/Http/Requests/App/Auth/LoginRequest.php index db82457c..e240dfc8 100644 --- a/app/Http/Requests/Auth/LoginRequest.php +++ b/app/Http/Requests/App/Auth/LoginRequest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Http\Requests\Auth; +namespace App\Http\Requests\App\Auth; use Illuminate\Auth\Events\Lockout; use Illuminate\Contracts\Validation\Rule; diff --git a/app/Http/Requests/StoreWorkspaceInviteRequest.php b/app/Http/Requests/App/Invite/StoreWorkspaceInviteRequest.php similarity index 96% rename from app/Http/Requests/StoreWorkspaceInviteRequest.php rename to app/Http/Requests/App/Invite/StoreWorkspaceInviteRequest.php index f5027daa..5ec53661 100644 --- a/app/Http/Requests/StoreWorkspaceInviteRequest.php +++ b/app/Http/Requests/App/Invite/StoreWorkspaceInviteRequest.php @@ -1,6 +1,6 @@ $this->id, 'platform' => $this->platform, - 'name' => $this->name, + 'display_name' => $this->display_name, 'username' => $this->username, - 'avatar' => $this->avatar, ]; } } diff --git a/app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php b/app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php new file mode 100644 index 00000000..1d12f47b --- /dev/null +++ b/app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php @@ -0,0 +1,26 @@ + + */ + public static function make(User $user): array + { + return [ + 'id' => $user->id, + 'name' => $user->name, + 'email' => $user->email, + 'email_verified_at' => $user->email_verified_at?->toIso8601String(), + 'current_workspace_id' => $user->current_workspace_id, + 'created_at' => $user->created_at->toIso8601String(), + 'updated_at' => $user->updated_at->toIso8601String(), + ]; + } +} diff --git a/app/Http/Resources/App/HandleInertiaRequests/AuthWorkspaceResource.php b/app/Http/Resources/App/HandleInertiaRequests/AuthWorkspaceResource.php new file mode 100644 index 00000000..49bacbc2 --- /dev/null +++ b/app/Http/Resources/App/HandleInertiaRequests/AuthWorkspaceResource.php @@ -0,0 +1,45 @@ + + */ + public static function make(Workspace $workspace, ?User $user = null): array + { + return [ + 'id' => $workspace->id, + 'name' => $workspace->name, + 'timezone' => $workspace->timezone, + 'created_at' => $workspace->created_at->toIso8601String(), + 'role' => $user ? self::resolveRole($workspace, $user) : null, + ]; + } + + /** + * @return array + */ + public static function summary(Workspace $workspace): array + { + return [ + 'id' => $workspace->id, + 'name' => $workspace->name, + ]; + } + + private static function resolveRole(Workspace $workspace, User $user): ?string + { + return $workspace->members() + ->where('users.id', $user->id) + ->first() + ?->pivot + ?->role; + } +} diff --git a/bootstrap/app.php b/bootstrap/app.php index b0957dd7..e8b623e8 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,9 +1,9 @@ env('TELESCOPE_ENABLED', true), + 'enabled' => env('TELESCOPE_ENABLED', false), /* |-------------------------------------------------------------------------- @@ -42,7 +42,7 @@ | */ - 'path' => env('TELESCOPE_PATH', 'telescope'), + 'path' => env('TELESCOPE_PATH', 'debug'), /* |-------------------------------------------------------------------------- diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 6082d653..fa6b2251 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -31,7 +31,12 @@ public function definition(): array 'email_verified_at' => now(), 'password' => static::$password ??= Hash::make('password'), 'remember_token' => Str::random(10), + 'current_workspace_id' => null, 'language_id' => Language::factory(), + 'stripe_id' => null, + 'pm_type' => null, + 'pm_last_four' => null, + 'trial_ends_at' => null, 'two_factor_secret' => null, 'two_factor_recovery_codes' => null, 'two_factor_confirmed_at' => null, diff --git a/resources/js/components/AppHeader.vue b/resources/js/components/AppHeader.vue index 45c1bc5b..cc851cdf 100644 --- a/resources/js/components/AppHeader.vue +++ b/resources/js/components/AppHeader.vue @@ -42,7 +42,7 @@ const props = withDefaults(defineProps(), { const page = usePage(); const auth = computed(() => page.props.auth); -const currentWorkspace = computed(() => page.props.currentWorkspace); +const currentWorkspace = computed(() => page.props.auth.currentWorkspace); const { urlIsActive } = useActiveUrl(); function activeItemStyles(url: NonNullable) { diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vue index 22a88daf..da375dde 100644 --- a/resources/js/components/AppSidebar.vue +++ b/resources/js/components/AppSidebar.vue @@ -66,8 +66,8 @@ interface Language { const page = usePage(); const auth = computed(() => page.props.auth); -const currentWorkspace = computed(() => page.props.currentWorkspace as Workspace | null); -const workspaces = computed(() => page.props.workspaces as Workspace[]); +const currentWorkspace = computed(() => page.props.auth.currentWorkspace as Workspace | null); +const workspaces = computed(() => page.props.auth.workspaces as Workspace[]); const languages = computed(() => page.props.languages as Language[]); const currentLanguage = computed(() => languages.value.find(l => l.id === auth.value.user.language_id)); @@ -109,7 +109,7 @@ const postsNavItems = computed(() => [ }, ]); -const canManageWorkspace = computed(() => auth.value.role !== 'member'); +const canManageWorkspace = computed(() => auth.value.currentWorkspace?.role !== 'member'); const configNavItems = computed(() => { const items: NavItem[] = [ diff --git a/resources/js/components/WorkspaceSwitcher.vue b/resources/js/components/WorkspaceSwitcher.vue index f46febb5..1600fbf8 100644 --- a/resources/js/components/WorkspaceSwitcher.vue +++ b/resources/js/components/WorkspaceSwitcher.vue @@ -20,8 +20,8 @@ interface Workspace { } const page = usePage(); -const currentWorkspace = computed(() => page.props.currentWorkspace as Workspace | null); -const workspaces = computed(() => page.props.workspaces as Workspace[]); +const currentWorkspace = computed(() => page.props.auth.currentWorkspace as Workspace | null); +const workspaces = computed(() => page.props.auth.workspaces as Workspace[]); function switchWorkspace(workspace: Workspace) { router.post(switchMethod.url(workspace.id), {}, { diff --git a/resources/js/layouts/settings/Layout.vue b/resources/js/layouts/settings/Layout.vue index e1b5e66d..5c730818 100644 --- a/resources/js/layouts/settings/Layout.vue +++ b/resources/js/layouts/settings/Layout.vue @@ -16,7 +16,7 @@ import { type NavItem, type SharedData } from '@/types'; const page = usePage(); const auth = computed(() => page.props.auth); -const canManageWorkspace = computed(() => auth.value.role !== 'member'); +const canManageWorkspace = computed(() => auth.value.currentWorkspace?.role !== 'member'); const navItems = computed(() => { const items: NavItem[] = [ diff --git a/routes/app.php b/routes/app.php index e5aec5a4..bb610185 100644 --- a/routes/app.php +++ b/routes/app.php @@ -25,7 +25,7 @@ use App\Http\Controllers\Auth\TikTokController; use App\Http\Controllers\Auth\XController; use App\Http\Controllers\Auth\YouTubeController; -use App\Http\Middleware\EnsureUserSetupIsComplete; +use App\Http\Middleware\App\EnsureUserSetupIsComplete; use Illuminate\Support\Facades\Route; Route::group( diff --git a/routes/auth.php b/routes/auth.php index 2ac434db..920b9e09 100644 --- a/routes/auth.php +++ b/routes/auth.php @@ -15,41 +15,51 @@ Route::group( [ 'domain' => 'app.'.parse_url(config('app.url'), PHP_URL_HOST), - 'middleware' => ['web'], ], function () { - - Route::middleware('guest')->group(function () { - Route::get('/register', [RegisteredUserController::class, 'create'])->name('register'); - Route::post('/register', [RegisteredUserController::class, 'store'])->name('register.store'); - - Route::get('/login', [AuthenticatedSessionController::class, 'create'])->name('login'); - Route::post('/login', [AuthenticatedSessionController::class, 'store'])->name('login.store'); - - Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])->name('password.request'); - Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])->name('password.email'); - - Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])->name('password.reset'); - Route::post('/reset-password', [NewPasswordController::class, 'store'])->name('password.store'); - }); - - // Invite routes - accessible by both guests and authenticated users Route::get('/invites/{invite}', [AcceptInviteController::class, 'show'])->name('app.invites.show'); - Route::post('/invites/{invite}/accept', [AcceptInviteController::class, 'accept'])->name('app.invites.accept')->middleware('auth'); - Route::post('/invites/{invite}/decline', [AcceptInviteController::class, 'decline'])->name('app.invites.decline')->middleware('auth'); + } +); - Route::middleware('auth')->group(function () { - Route::get('/verify-email', EmailVerificationPromptController::class)->name('verification.notice'); +Route::group( + [ + 'domain' => 'app.'.parse_url(config('app.url'), PHP_URL_HOST), + 'middleware' => ['guest'], + ], + function () { + Route::get('/register', [RegisteredUserController::class, 'create'])->name('register'); + Route::post('/register', [RegisteredUserController::class, 'store'])->name('register.store'); - Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class) - ->middleware(['signed', 'throttle:6,1']) - ->name('verification.verify'); + Route::get('/login', [AuthenticatedSessionController::class, 'create'])->name('login'); + Route::post('/login', [AuthenticatedSessionController::class, 'store'])->name('login.store'); - Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store']) - ->middleware('throttle:6,1') - ->name('verification.send'); + Route::get('/forgot-password', [PasswordResetLinkController::class, 'create'])->name('password.request'); + Route::post('/forgot-password', [PasswordResetLinkController::class, 'store'])->name('password.email'); - Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout'); - }); + Route::get('/reset-password/{token}', [NewPasswordController::class, 'create'])->name('password.reset'); + Route::post('/reset-password', [NewPasswordController::class, 'store'])->name('password.store'); + } +); - }); // end domain group +Route::group( + [ + 'domain' => 'app.'.parse_url(config('app.url'), PHP_URL_HOST), + 'middleware' => ['auth'], + ], + function () { + Route::get('/verify-email', EmailVerificationPromptController::class)->name('verification.notice'); + + Route::get('/verify-email/{id}/{hash}', VerifyEmailController::class) + ->middleware(['signed', 'throttle:6,1']) + ->name('verification.verify'); + + Route::post('/email/verification-notification', [EmailVerificationNotificationController::class, 'store']) + ->middleware('throttle:6,1') + ->name('verification.send'); + + Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])->name('logout'); + + Route::post('/invites/{invite}/accept', [AcceptInviteController::class, 'accept'])->name('app.invites.accept'); + Route::post('/invites/{invite}/decline', [AcceptInviteController::class, 'decline'])->name('app.invites.decline'); + } +); From f5a8ea72f1cacfc3cda6a53da9c12051d2dd6a38 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sun, 29 Mar 2026 21:15:06 -0300 Subject: [PATCH 07/91] fix: use DatePicker component for API key expiration date --- resources/js/pages/settings/ApiKeys.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/js/pages/settings/ApiKeys.vue b/resources/js/pages/settings/ApiKeys.vue index 08ee04b6..2f13a72d 100644 --- a/resources/js/pages/settings/ApiKeys.vue +++ b/resources/js/pages/settings/ApiKeys.vue @@ -4,6 +4,7 @@ import { IconKey, IconCopy, IconTrash, IconPlus } from '@tabler/icons-vue'; import { computed, ref, watch } from 'vue'; import ConfirmDeleteModal from '@/components/ConfirmDeleteModal.vue'; +import DatePicker from '@/components/DatePicker.vue'; import HeadingSmall from '@/components/HeadingSmall.vue'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; @@ -205,12 +206,12 @@ const closeTokenDialog = () => {

- - Expiration date (optional) +

{{ form.errors.expires_at }} From 614cb99435762076b6c9b21da992eb449fe17f2d Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sun, 29 Mar 2026 21:37:11 -0300 Subject: [PATCH 08/91] refactor: redesign sidebar + layout to match Sendkit pattern - Workspace switcher in sidebar header (dropdown with team list) - NavMain component with label and activePattern support - User menu in sidebar footer via NavUser component - UserMenuContent with theme switcher submenu (light/dark/system) - UserInfo component with avatar fallback and customizable classes - AppSidebarLayout using SidebarProvider/SidebarInset directly - AppSidebarHeader with right slot for header actions - AppLayout with fullWidth and header-right slot support - Remove workspace/user/theme/language from header dropdown - 702 tests passing, build passing --- lang/php_en.json | 1 + lang/php_pt-br.json | 1 + resources/css/app.css | 295 ++++++++------ resources/js/components/AppSidebar.vue | 381 +++++------------- resources/js/components/AppSidebarHeader.vue | 15 +- resources/js/components/NavMain.vue | 7 +- resources/js/components/NavUser.vue | 12 +- resources/js/components/UserInfo.vue | 23 +- resources/js/components/UserMenuContent.vue | 67 ++- resources/js/layouts/AppLayout.vue | 15 +- resources/js/layouts/app/AppSidebarLayout.vue | 42 +- 11 files changed, 403 insertions(+), 456 deletions(-) create mode 100644 lang/php_en.json create mode 100644 lang/php_pt-br.json diff --git a/lang/php_en.json b/lang/php_en.json new file mode 100644 index 00000000..156232fe --- /dev/null +++ b/lang/php_en.json @@ -0,0 +1 @@ +{"auth.failed":"These credentials do not match our records.","auth.password":"The provided password is incorrect.","auth.throttle":"Too many login attempts. Please try again in :seconds seconds.","pagination.previous":"« Previous","pagination.next":"Next »","passwords.reset":"Your password has been reset.","passwords.sent":"We have emailed your password reset link.","passwords.throttled":"Please wait before retrying.","passwords.token":"This password reset token is invalid.","passwords.user":"We can't find a user with that email address.","validation.accepted":"The :attribute field must be accepted.","validation.accepted_if":"The :attribute field must be accepted when :other is :value.","validation.active_url":"The :attribute field must be a valid URL.","validation.after":"The :attribute field must be a date after :date.","validation.after_or_equal":"The :attribute field must be a date after or equal to :date.","validation.alpha":"The :attribute field must only contain letters.","validation.alpha_dash":"The :attribute field must only contain letters, numbers, dashes, and underscores.","validation.alpha_num":"The :attribute field must only contain letters and numbers.","validation.any_of":"The :attribute field is invalid.","validation.array":"The :attribute field must be an array.","validation.ascii":"The :attribute field must only contain single-byte alphanumeric characters and symbols.","validation.before":"The :attribute field must be a date before :date.","validation.before_or_equal":"The :attribute field must be a date before or equal to :date.","validation.between.array":"The :attribute field must have between :min and :max items.","validation.between.file":"The :attribute field must be between :min and :max kilobytes.","validation.between.numeric":"The :attribute field must be between :min and :max.","validation.between.string":"The :attribute field must be between :min and :max characters.","validation.boolean":"The :attribute field must be true or false.","validation.can":"The :attribute field contains an unauthorized value.","validation.confirmed":"The :attribute field confirmation does not match.","validation.contains":"The :attribute field is missing a required value.","validation.current_password":"The password is incorrect.","validation.date":"The :attribute field must be a valid date.","validation.date_equals":"The :attribute field must be a date equal to :date.","validation.date_format":"The :attribute field must match the format :format.","validation.decimal":"The :attribute field must have :decimal decimal places.","validation.declined":"The :attribute field must be declined.","validation.declined_if":"The :attribute field must be declined when :other is :value.","validation.different":"The :attribute field and :other must be different.","validation.digits":"The :attribute field must be :digits digits.","validation.digits_between":"The :attribute field must be between :min and :max digits.","validation.dimensions":"The :attribute field has invalid image dimensions.","validation.distinct":"The :attribute field has a duplicate value.","validation.doesnt_contain":"The :attribute field must not contain any of the following: :values.","validation.doesnt_end_with":"The :attribute field must not end with one of the following: :values.","validation.doesnt_start_with":"The :attribute field must not start with one of the following: :values.","validation.email":"The :attribute field must be a valid email address.","validation.encoding":"The :attribute field must be encoded in :encoding.","validation.ends_with":"The :attribute field must end with one of the following: :values.","validation.enum":"The selected :attribute is invalid.","validation.exists":"The selected :attribute is invalid.","validation.extensions":"The :attribute field must have one of the following extensions: :values.","validation.file":"The :attribute field must be a file.","validation.filled":"The :attribute field must have a value.","validation.gt.array":"The :attribute field must have more than :value items.","validation.gt.file":"The :attribute field must be greater than :value kilobytes.","validation.gt.numeric":"The :attribute field must be greater than :value.","validation.gt.string":"The :attribute field must be greater than :value characters.","validation.gte.array":"The :attribute field must have :value items or more.","validation.gte.file":"The :attribute field must be greater than or equal to :value kilobytes.","validation.gte.numeric":"The :attribute field must be greater than or equal to :value.","validation.gte.string":"The :attribute field must be greater than or equal to :value characters.","validation.hex_color":"The :attribute field must be a valid hexadecimal color.","validation.image":"The :attribute field must be an image.","validation.in":"The selected :attribute is invalid.","validation.in_array":"The :attribute field must exist in :other.","validation.in_array_keys":"The :attribute field must contain at least one of the following keys: :values.","validation.integer":"The :attribute field must be an integer.","validation.ip":"The :attribute field must be a valid IP address.","validation.ipv4":"The :attribute field must be a valid IPv4 address.","validation.ipv6":"The :attribute field must be a valid IPv6 address.","validation.json":"The :attribute field must be a valid JSON string.","validation.list":"The :attribute field must be a list.","validation.lowercase":"The :attribute field must be lowercase.","validation.lt.array":"The :attribute field must have less than :value items.","validation.lt.file":"The :attribute field must be less than :value kilobytes.","validation.lt.numeric":"The :attribute field must be less than :value.","validation.lt.string":"The :attribute field must be less than :value characters.","validation.lte.array":"The :attribute field must not have more than :value items.","validation.lte.file":"The :attribute field must be less than or equal to :value kilobytes.","validation.lte.numeric":"The :attribute field must be less than or equal to :value.","validation.lte.string":"The :attribute field must be less than or equal to :value characters.","validation.mac_address":"The :attribute field must be a valid MAC address.","validation.max.array":"The :attribute field must not have more than :max items.","validation.max.file":"The :attribute field must not be greater than :max kilobytes.","validation.max.numeric":"The :attribute field must not be greater than :max.","validation.max.string":"The :attribute field must not be greater than :max characters.","validation.max_digits":"The :attribute field must not have more than :max digits.","validation.mimes":"The :attribute field must be a file of type: :values.","validation.mimetypes":"The :attribute field must be a file of type: :values.","validation.min.array":"The :attribute field must have at least :min items.","validation.min.file":"The :attribute field must be at least :min kilobytes.","validation.min.numeric":"The :attribute field must be at least :min.","validation.min.string":"The :attribute field must be at least :min characters.","validation.min_digits":"The :attribute field must have at least :min digits.","validation.missing":"The :attribute field must be missing.","validation.missing_if":"The :attribute field must be missing when :other is :value.","validation.missing_unless":"The :attribute field must be missing unless :other is :value.","validation.missing_with":"The :attribute field must be missing when :values is present.","validation.missing_with_all":"The :attribute field must be missing when :values are present.","validation.multiple_of":"The :attribute field must be a multiple of :value.","validation.not_in":"The selected :attribute is invalid.","validation.not_regex":"The :attribute field format is invalid.","validation.numeric":"The :attribute field must be a number.","validation.password.letters":"The :attribute field must contain at least one letter.","validation.password.mixed":"The :attribute field must contain at least one uppercase and one lowercase letter.","validation.password.numbers":"The :attribute field must contain at least one number.","validation.password.symbols":"The :attribute field must contain at least one symbol.","validation.password.uncompromised":"The given :attribute has appeared in a data leak. Please choose a different :attribute.","validation.present":"The :attribute field must be present.","validation.present_if":"The :attribute field must be present when :other is :value.","validation.present_unless":"The :attribute field must be present unless :other is :value.","validation.present_with":"The :attribute field must be present when :values is present.","validation.present_with_all":"The :attribute field must be present when :values are present.","validation.prohibited":"The :attribute field is prohibited.","validation.prohibited_if":"The :attribute field is prohibited when :other is :value.","validation.prohibited_if_accepted":"The :attribute field is prohibited when :other is accepted.","validation.prohibited_if_declined":"The :attribute field is prohibited when :other is declined.","validation.prohibited_unless":"The :attribute field is prohibited unless :other is in :values.","validation.prohibits":"The :attribute field prohibits :other from being present.","validation.regex":"The :attribute field format is invalid.","validation.required":"The :attribute field is required.","validation.required_array_keys":"The :attribute field must contain entries for: :values.","validation.required_if":"The :attribute field is required when :other is :value.","validation.required_if_accepted":"The :attribute field is required when :other is accepted.","validation.required_if_declined":"The :attribute field is required when :other is declined.","validation.required_unless":"The :attribute field is required unless :other is in :values.","validation.required_with":"The :attribute field is required when :values is present.","validation.required_with_all":"The :attribute field is required when :values are present.","validation.required_without":"The :attribute field is required when :values is not present.","validation.required_without_all":"The :attribute field is required when none of :values are present.","validation.same":"The :attribute field must match :other.","validation.size.array":"The :attribute field must contain :size items.","validation.size.file":"The :attribute field must be :size kilobytes.","validation.size.numeric":"The :attribute field must be :size.","validation.size.string":"The :attribute field must be :size characters.","validation.starts_with":"The :attribute field must start with one of the following: :values.","validation.string":"The :attribute field must be a string.","validation.timezone":"The :attribute field must be a valid timezone.","validation.unique":"The :attribute has already been taken.","validation.uploaded":"The :attribute failed to upload.","validation.uppercase":"The :attribute field must be uppercase.","validation.url":"The :attribute field must be a valid URL.","validation.ulid":"The :attribute field must be a valid ULID.","validation.uuid":"The :attribute field must be a valid UUID.","validation.custom.attribute-name.rule-name":"custom-message","accounts.title":"Connections","accounts.page_title":"Connected Accounts","accounts.description":"Connect your social networks to schedule and publish posts","accounts.not_connected":"Not connected","accounts.connect":"Connect","accounts.connection_lost":"Connection lost","accounts.reconnect_account":"Reconnect account","accounts.view_profile":"View profile","accounts.disconnect":"Disconnect","accounts.disconnect_modal.title":"Disconnect Account","accounts.disconnect_modal.description":"Are you sure you want to disconnect this account? You can reconnect it at any time.","accounts.disconnect_modal.confirm":"Disconnect","accounts.disconnect_modal.cancel":"Cancel","accounts.bluesky.title":"Connect Bluesky","accounts.bluesky.description":"Enter your credentials to connect","accounts.bluesky.email":"Email","accounts.bluesky.email_placeholder":"yourhandle.bsky.social","accounts.bluesky.app_password":"App Password","accounts.bluesky.app_password_placeholder":"xxxx-xxxx-xxxx-xxxx","accounts.bluesky.app_password_hint":"Use an App Password for security. Create one at bsky.app/settings.","accounts.bluesky.submit":"Connect Bluesky","accounts.bluesky.submitting":"Connecting...","accounts.mastodon.title":"Connect Mastodon","accounts.mastodon.description":"Enter your Mastodon instance","accounts.mastodon.instance_url":"Instance URL","accounts.mastodon.instance_placeholder":"https://mastodon.social","accounts.mastodon.instance_hint":"Enter your Mastodon instance URL (e.g., mastodon.social, techhub.social)","accounts.mastodon.submit":"Continue with Mastodon","accounts.mastodon.submitting":"Connecting...","accounts.facebook.title":"Select Facebook Page","accounts.facebook.description":"Choose which page you want to connect","accounts.facebook.no_pages":"No pages found","accounts.facebook.no_pages_description":"You are not an admin of any Facebook page.","accounts.facebook.page_label":"Facebook Page","accounts.linkedin.title":"Select LinkedIn Page","accounts.linkedin.description":"Choose which page you want to connect","accounts.linkedin.no_pages":"No pages found","accounts.linkedin.no_pages_description":"You are not an administrator of any LinkedIn page.","accounts.linkedin.page_label":"LinkedIn Page","accounts.flash.disconnected":"Account disconnected successfully!","accounts.flash.connected":"Account connected successfully!","accounts.flash.session_expired":"Session expired. Please try again.","accounts.flash.workspace_not_found":"Workspace not found.","accounts.flash.already_connected":"This platform is already connected.","accounts.flash.no_youtube_channels":"No YouTube channels found. Please create a channel first.","auth.flash.welcome":"Welcome to TryPost!","auth.flash.welcome_trial":"Welcome to TryPost! Your trial has started.","auth.login.title":"Log in to your account","auth.login.description":"Enter your email and password below to log in","auth.login.page_title":"Log in","auth.login.email":"Email address","auth.login.password":"Password","auth.login.forgot_password":"Forgot password?","auth.login.remember_me":"Remember me","auth.login.submit":"Log in","auth.login.no_account":"Don't have an account?","auth.login.sign_up":"Sign up","auth.register.title":"Create an account","auth.register.description":"Enter your details below to create your account","auth.register.page_title":"Register","auth.register.name":"Name","auth.register.name_placeholder":"Full name","auth.register.email":"Email address","auth.register.password":"Password","auth.register.submit":"Create account","auth.register.has_account":"Already have an account?","auth.register.log_in":"Log in","auth.forgot_password.title":"Forgot password","auth.forgot_password.description":"Enter your email to receive a password reset link","auth.forgot_password.page_title":"Forgot password","auth.forgot_password.email":"Email address","auth.forgot_password.submit":"Email password reset link","auth.forgot_password.return_to":"Or, return to","auth.forgot_password.log_in":"log in","auth.reset_password.title":"Reset password","auth.reset_password.description":"Please enter your new password below","auth.reset_password.page_title":"Reset password","auth.reset_password.email":"Email","auth.reset_password.password":"Password","auth.reset_password.confirm_password":"Confirm Password","auth.reset_password.confirm_placeholder":"Confirm password","auth.reset_password.submit":"Reset password","auth.verify_email.title":"Verify email","auth.verify_email.description":"Please verify your email address by clicking on the link we just emailed to you.","auth.verify_email.page_title":"Email verification","auth.verify_email.link_sent":"A new verification link has been sent to the email address you provided during registration.","auth.verify_email.resend":"Resend verification email","auth.verify_email.log_out":"Log out","auth.accept_invite.page_title":"Accept Invite","auth.accept_invite.title":"You've been invited!","auth.accept_invite.description":"You've been invited to join the :workspace workspace.","auth.accept_invite.workspace":"Workspace","auth.accept_invite.your_role":"Your role","auth.accept_invite.email":"Email","auth.accept_invite.accept":"Accept Invite","auth.accept_invite.decline":"Decline Invite","auth.accept_invite.login_prompt":"Log in or create an account to accept this invite.","auth.accept_invite.log_in":"Log in","auth.accept_invite.create_account":"Create Account","billing.title":"Subscription","billing.description":"Manage your subscription and payment method","billing.trial.title":"Trial period active","billing.trial.description":"Your trial ends on :date. After that, your subscription will be charged automatically.","billing.subscription.title":"Your Subscription","billing.subscription.workspaces":"Workspaces","billing.subscription.quantity":"Subscription quantity","billing.subscription.expires":"Expires :date","billing.subscription.canceled_on":"Your subscription will be canceled on :date","billing.subscription.manage":"Manage on Stripe","billing.invoices.title":"Invoices","billing.invoices.description":"Payment history","billing.invoices.empty":"No invoices found","billing.invoices.paid":"Paid","billing.status.active":"Active","billing.status.canceled":"Canceled","billing.status.incomplete":"Incomplete","billing.status.incomplete_expired":"Expired","billing.status.past_due":"Past due","billing.status.trialing":"Trial","billing.status.unpaid":"Unpaid","calendar.title":"Calendar","calendar.today":"Today","calendar.day":"Day","calendar.week":"Week","calendar.month":"Month","calendar.new_post":"New Post","calendar.no_content":"No content","calendar.more":"+:count more","hashtags.title":"Hashtags","hashtags.description":"Create hashtag groups to quickly add to your posts","hashtags.new_group":"New Group","hashtags.no_groups_yet":"No hashtag groups yet","hashtags.no_groups_description":"Create hashtag groups to quickly add popular hashtags to your posts","hashtags.create_first_group":"Create your first group","hashtags.hashtags_count":":count hashtags","hashtags.create.title":"Create Hashtag Group","hashtags.create.description":"Give your group a name and add hashtags separated by spaces or commas","hashtags.create.name":"Group Name","hashtags.create.name_placeholder":"e.g. Marketing, Travel, Food","hashtags.create.hashtags":"Hashtags","hashtags.create.hashtags_placeholder":"#marketing #socialmedia #business #growth","hashtags.create.hashtags_hint":"Enter hashtags separated by spaces or commas. Include the # symbol.","hashtags.create.submit":"Create Group","hashtags.create.submitting":"Creating...","hashtags.edit.title":"Edit Hashtag Group","hashtags.edit.description":"Update the name and hashtags for this group","hashtags.edit.name":"Group Name","hashtags.edit.name_placeholder":"e.g. Marketing, Travel, Food","hashtags.edit.hashtags":"Hashtags","hashtags.edit.hashtags_placeholder":"#marketing #socialmedia #business #growth","hashtags.edit.hashtags_hint":"Enter hashtags separated by spaces or commas. Include the # symbol.","hashtags.edit.submit":"Save Changes","hashtags.edit.submitting":"Saving...","hashtags.delete.title":"Delete Hashtag Group","hashtags.delete.description":"Are you sure you want to delete this hashtag group? This action cannot be undone.","hashtags.delete.confirm":"Delete","hashtags.delete.cancel":"Cancel","hashtags.flash.created":"Hashtag group created successfully!","hashtags.flash.updated":"Hashtag group updated successfully!","hashtags.flash.deleted":"Hashtag group deleted successfully!","labels.title":"Labels","labels.description":"Create labels to organize and categorize your posts","labels.new_label":"New Label","labels.no_labels_yet":"No labels yet","labels.create_first_label":"Create your first label","labels.create.title":"Create Label","labels.create.description":"Give your label a name and pick a color","labels.create.name":"Name","labels.create.name_placeholder":"Enter label name...","labels.create.color":"Color","labels.create.submit":"Create Label","labels.create.submitting":"Creating...","labels.edit.title":"Edit Label","labels.edit.description":"Update the name and color for this label","labels.edit.name":"Name","labels.edit.name_placeholder":"Enter label name...","labels.edit.color":"Color","labels.edit.submit":"Save Changes","labels.edit.submitting":"Saving...","labels.delete.title":"Delete Label","labels.delete.description":"Are you sure you want to delete this label? This action cannot be undone.","labels.delete.confirm":"Delete","labels.delete.cancel":"Cancel","labels.flash.created":"Label created successfully!","labels.flash.updated":"Label updated successfully!","labels.flash.deleted":"Label deleted successfully!","mail.workspace_connections_disconnected.subject":"{1} :count account needs to be reconnected in :workspace|[2,*] :count accounts need to be reconnected in :workspace","mail.workspace_connections_disconnected.title":"Accounts Need Reconnection","mail.workspace_connections_disconnected.intro":"The following social accounts in your :workspace workspace have been disconnected and need to be reconnected:","mail.workspace_connections_disconnected.reasons_title":"This may have happened because:","mail.workspace_connections_disconnected.reason_expired":"Access tokens expired","mail.workspace_connections_disconnected.reason_revoked":"You revoked access to TryPost on the platform","mail.workspace_connections_disconnected.reason_changed":"The platform changed their authentication requirements","mail.workspace_connections_disconnected.reconnect_cta":"Please reconnect these accounts to continue scheduling and publishing posts.","mail.workspace_connections_disconnected.button":"Reconnect Accounts","posts.title":"Posts","posts.all_posts":"All Posts","posts.new_post":"New Post","posts.no_posts":"No posts found","posts.start_creating":"Start by creating your first post.","posts.manage_posts":"Manage all your posts","posts.delete_confirm":"Are you sure you want to delete this post?","posts.by":"by","posts.actions.view":"View post","posts.actions.delete":"Delete post","posts.form.post_type":"Post Type","posts.form.board":"Board","posts.form.select_board":"Select a board","posts.form.search_board":"Search board...","posts.form.no_board_found":"No board found","posts.form.media":"Media","posts.form.min":"Min","posts.form.uploading":"Uploading...","posts.form.drop_to_upload":"Drop to upload","posts.form.drag_and_drop":"Drag & drop or click to upload","posts.form.photos_and_videos":"Photos and videos","posts.form.photos_only":"Photos only","posts.form.videos_only":"Videos only","posts.form.drag_to_reorder":"Drag to reorder","posts.form.caption":"Caption","posts.form.write_caption":"Write your caption...","posts.status.draft":"Draft","posts.status.scheduled":"Scheduled","posts.status.publishing":"Publishing","posts.status.published":"Published","posts.status.partially_published":"Partially Published","posts.status.failed":"Failed","posts.descriptions.draft":"Posts waiting to be scheduled","posts.descriptions.scheduled":"Posts scheduled for publishing","posts.descriptions.published":"Posts already published","posts.edit.title":"Edit Post","posts.edit.view_title":"View Post","posts.edit.manage_platforms":"Manage platforms","posts.edit.sync":"Sync","posts.edit.labels":"Labels","posts.edit.hashtags":"Hashtags","posts.edit.schedule":"Schedule","posts.edit.publish":"Publish","posts.edit.delete":"Delete","posts.edit.settings":"Settings","posts.edit.schedule_for":"Schedule for","posts.edit.saving":"Saving...","posts.edit.saved":"Saved","posts.edit.scheduled_at":"Scheduled:","posts.edit.published_at":"Published:","posts.edit.media":"Media","posts.edit.caption":"Caption","posts.edit.no_caption":"No caption","posts.edit.no_content":"No content","posts.edit.empty_state.title":"No platforms selected","posts.edit.empty_state.description":"Select at least one platform to create your post","posts.edit.delete_modal.title":"Delete Post","posts.edit.delete_modal.description":"Are you sure you want to delete this post? This action cannot be undone.","posts.edit.delete_modal.action":"Delete","posts.edit.delete_modal.cancel":"Cancel","posts.edit.sync_enable.title":"Enable sync?","posts.edit.sync_enable.description":"All platforms will share the same content. Any custom edits made to individual platforms will be replaced with the current content.","posts.edit.sync_enable.cancel":"Cancel","posts.edit.sync_enable.action":"Enable sync","posts.edit.sync_disable.title":"Disable sync?","posts.edit.sync_disable.description":"Each platform will keep its current content, but future edits will only apply to the platform you're editing.","posts.edit.sync_disable.customize_note":"You'll be able to customize the content for each platform individually.","posts.edit.sync_disable.cancel":"Cancel","posts.edit.sync_disable.action":"Disable sync","posts.edit.platforms_dialog.title":"Select Platforms","posts.edit.platforms_dialog.description":"Choose which platforms to publish this post to.","posts.edit.hashtags_modal.search":"Search hashtags...","posts.edit.hashtags_modal.no_results":"No hashtags found.","posts.edit.validation.select_board":"Select a board","posts.edit.validation.images_not_supported":"Images not supported","posts.edit.validation.videos_not_supported":"Videos not supported","posts.edit.validation.max_images":"Max :count images","posts.edit.validation.requires_media":"Requires media","posts.edit.validation.exceeded":":count exceeded","posts.edit.validation.does_not_support_images":":platform does not support images","posts.edit.validation.supports_up_to_images":":platform supports up to :count images","posts.edit.validation.does_not_support_videos":":platform does not support videos","posts.content_types.instagram_feed.label":"Feed Post","posts.content_types.instagram_feed.description":"Appears in your feed and profile","posts.content_types.instagram_reel.label":"Reel","posts.content_types.instagram_reel.description":"Short video up to 90 seconds","posts.content_types.instagram_story.label":"Story","posts.content_types.instagram_story.description":"Disappears after 24 hours","posts.content_types.linkedin_post.label":"Post","posts.content_types.linkedin_post.description":"Standard post with text and media","posts.content_types.linkedin_carousel.label":"Carousel","posts.content_types.linkedin_carousel.description":"Swipeable images","posts.content_types.linkedin_page_post.label":"Post","posts.content_types.linkedin_page_post.description":"Standard post with text and media","posts.content_types.linkedin_page_carousel.label":"Carousel","posts.content_types.linkedin_page_carousel.description":"Swipeable images","posts.content_types.facebook_post.label":"Post","posts.content_types.facebook_post.description":"Standard post on your page","posts.content_types.facebook_reel.label":"Reel","posts.content_types.facebook_reel.description":"Short video up to 90 seconds","posts.content_types.facebook_story.label":"Story","posts.content_types.facebook_story.description":"Disappears after 24 hours","posts.content_types.tiktok_video.label":"Video","posts.content_types.tiktok_video.description":"Short-form video content","posts.content_types.youtube_short.label":"Short","posts.content_types.youtube_short.description":"Vertical video up to 60 seconds","posts.content_types.x_post.label":"Post","posts.content_types.x_post.description":"Tweet with text and media","posts.content_types.threads_post.label":"Post","posts.content_types.threads_post.description":"Text post with optional media","posts.content_types.pinterest_pin.label":"Pin","posts.content_types.pinterest_pin.description":"Image pin with link","posts.content_types.pinterest_video_pin.label":"Video Pin","posts.content_types.pinterest_video_pin.description":"Video content","posts.content_types.pinterest_carousel.label":"Carousel","posts.content_types.pinterest_carousel.description":"2-5 images","posts.content_types.bluesky_post.label":"Post","posts.content_types.bluesky_post.description":"Text post with optional images","posts.content_types.mastodon_post.label":"Post","posts.content_types.mastodon_post.description":"Text post with optional media","posts.platforms.linkedin":"LinkedIn","posts.platforms.linkedin-page":"LinkedIn Page","posts.platforms.x":"X","posts.platforms.tiktok":"TikTok","posts.platforms.youtube":"YouTube Shorts","posts.platforms.facebook":"Facebook Page","posts.platforms.instagram":"Instagram","posts.platforms.threads":"Threads","posts.platforms.pinterest":"Pinterest","posts.platforms.bluesky":"Bluesky","posts.platforms.mastodon":"Mastodon","posts.flash.scheduled":"Post scheduled successfully!","posts.flash.publishing":"Post is being published!","posts.flash.deleted":"Post deleted successfully!","posts.flash.cannot_edit_published":"Published posts cannot be edited.","posts.flash.connect_first":"Connect at least one social network before creating a post.","posts.errors.account_disconnected":"Social account is disconnected","settings.title":"Settings","settings.description":"Manage your profile and account settings","settings.nav.profile":"Profile","settings.nav.password":"Password","settings.nav.workspace":"Workspace","settings.nav.members":"Members","settings.nav.billing":"Billing","settings.profile.title":"Profile settings","settings.profile.heading":"Profile information","settings.profile.description":"Update your name and email address","settings.profile.avatar":"Avatar","settings.profile.name":"Name","settings.profile.name_placeholder":"Full name","settings.profile.email":"Email address","settings.profile.email_placeholder":"Email address","settings.profile.email_unverified":"Your email address is unverified.","settings.profile.resend_verification":"Click here to resend the verification email.","settings.profile.verification_sent":"A new verification link has been sent to your email address.","settings.profile.save":"Save","settings.password.title":"Password settings","settings.password.heading":"Update password","settings.password.description":"Ensure your account is using a long, random password to stay secure","settings.password.current_password":"Current password","settings.password.current_password_placeholder":"Current password","settings.password.new_password":"New password","settings.password.new_password_placeholder":"New password","settings.password.confirm_password":"Confirm password","settings.password.confirm_password_placeholder":"Confirm password","settings.password.save":"Save password","settings.delete_account.heading":"Delete account","settings.delete_account.description":"Delete your account and all of its resources","settings.delete_account.warning":"Warning","settings.delete_account.warning_message":"Please proceed with caution, this cannot be undone.","settings.delete_account.button":"Delete account","settings.delete_account.modal_title":"Are you sure you want to delete your account?","settings.delete_account.modal_description":"Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.","settings.delete_account.password":"Password","settings.delete_account.password_placeholder":"Password","settings.delete_account.cancel":"Cancel","settings.delete_account.confirm":"Delete account","settings.workspace.title":"Workspace settings","settings.workspace.heading":"Workspace settings","settings.workspace.description":"Update your workspace name, logo, and timezone","settings.workspace.logo":"Logo","settings.workspace.name":"Name","settings.workspace.name_placeholder":"My Workspace","settings.workspace.timezone":"Timezone","settings.workspace.save":"Save","settings.workspace.saved":"Saved.","settings.members.title":"Members","settings.members.heading":"Team members","settings.members.description":"Manage members and invites for this workspace","settings.members.invite.title":"Invite Member","settings.members.invite.description":"Send an email invite to add collaborators","settings.members.invite.email":"Email","settings.members.invite.email_placeholder":"collaborator@email.com","settings.members.invite.role":"Role","settings.members.invite.role_placeholder":"Select a role","settings.members.invite.submit":"Send Invite","settings.members.invite.cancel_confirm":"Are you sure you want to cancel this invite?","settings.members.pending.title":"Pending Invites","settings.members.pending.description":"Invites awaiting acceptance","settings.members.pending.empty":"No pending invites","settings.members.list.title":"Members","settings.members.list.description":"People with access to this workspace","settings.members.list.empty":"No members besides the owner","settings.members.list.remove_confirm":"Are you sure you want to remove this member?","settings.members.roles.owner":"Owner","settings.members.roles.admin":"Admin","settings.members.roles.member":"Member","settings.members.flash.invite_sent":"Invite sent successfully!","settings.members.flash.invite_deleted":"Invite deleted.","settings.members.flash.member_removed":"Member removed successfully.","settings.members.flash.wrong_email":"This invite is for a different email address.","settings.members.flash.already_member":"You are already a member of this workspace.","settings.members.flash.invite_accepted":"Welcome! You are now a member of the workspace.","settings.members.flash.invite_declined":"Invite declined.","settings.flash.profile_updated":"Profile updated successfully!","settings.flash.language_updated":"Language updated successfully!","settings.flash.password_updated":"Password updated successfully!","settings.flash.workspace_updated":"Settings updated successfully!","sidebar.select_workspace":"Select workspace","sidebar.create_workspace":"Create workspace","sidebar.create_post":"Create post","sidebar.profile":"Profile","sidebar.log_out":"Log out","sidebar.workspace":"Workspace: :name","sidebar.workspace_select":"Workspace: Select","sidebar.theme":"Theme: :name","sidebar.theme_light":"Light","sidebar.theme_dark":"Dark","sidebar.theme_system":"System","sidebar.language":"Language: :name","sidebar.language_select":"Language: Select","sidebar.groups.posts":"Posts","sidebar.groups.configuration":"Configurations","sidebar.groups.support":"Support","sidebar.posts.calendar":"Calendar","sidebar.posts.all":"All","sidebar.posts.scheduled":"Scheduled","sidebar.posts.posted":"Posted","sidebar.posts.drafts":"Drafts","sidebar.config.connections":"Connections","sidebar.config.hashtags":"Hashtags","sidebar.config.labels":"Labels","sidebar.config.settings":"Settings","sidebar.support.discord":"Discord","sidebar.support.share_feedback":"Share feedback","sidebar.support.last_updates":"Last Updates","sidebar.support.docs":"Docs"} \ No newline at end of file diff --git a/lang/php_pt-br.json b/lang/php_pt-br.json new file mode 100644 index 00000000..b71de77d --- /dev/null +++ b/lang/php_pt-br.json @@ -0,0 +1 @@ +{"accounts.title":"Conexões","accounts.page_title":"Contas Conectadas","accounts.description":"Conecte suas redes sociais para agendar e publicar posts","accounts.not_connected":"Não conectado","accounts.connect":"Conectar","accounts.connection_lost":"Conexão perdida","accounts.reconnect_account":"Reconectar conta","accounts.view_profile":"Ver perfil","accounts.disconnect":"Desconectar","accounts.disconnect_modal.title":"Desconectar Conta","accounts.disconnect_modal.description":"Tem certeza que deseja desconectar esta conta? Você pode reconectá-la a qualquer momento.","accounts.disconnect_modal.confirm":"Desconectar","accounts.disconnect_modal.cancel":"Cancelar","accounts.bluesky.title":"Conectar Bluesky","accounts.bluesky.description":"Digite suas credenciais para conectar","accounts.bluesky.email":"E-mail","accounts.bluesky.email_placeholder":"seuhandle.bsky.social","accounts.bluesky.app_password":"Senha do App","accounts.bluesky.app_password_placeholder":"xxxx-xxxx-xxxx-xxxx","accounts.bluesky.app_password_hint":"Use uma Senha do App por segurança. Crie uma em bsky.app/settings.","accounts.bluesky.submit":"Conectar Bluesky","accounts.bluesky.submitting":"Conectando...","accounts.mastodon.title":"Conectar Mastodon","accounts.mastodon.description":"Digite a instância do seu Mastodon","accounts.mastodon.instance_url":"URL da Instância","accounts.mastodon.instance_placeholder":"https://mastodon.social","accounts.mastodon.instance_hint":"Digite a URL da sua instância Mastodon (ex: mastodon.social, techhub.social)","accounts.mastodon.submit":"Continuar com Mastodon","accounts.mastodon.submitting":"Conectando...","accounts.facebook.title":"Selecionar Página do Facebook","accounts.facebook.description":"Escolha qual página você deseja conectar","accounts.facebook.no_pages":"Nenhuma página encontrada","accounts.facebook.no_pages_description":"Você não é administrador de nenhuma página do Facebook.","accounts.facebook.page_label":"Página do Facebook","accounts.linkedin.title":"Selecionar Página do LinkedIn","accounts.linkedin.description":"Escolha qual página você deseja conectar","accounts.linkedin.no_pages":"Nenhuma página encontrada","accounts.linkedin.no_pages_description":"Você não é administrador de nenhuma página do LinkedIn.","accounts.linkedin.page_label":"Página do LinkedIn","accounts.flash.disconnected":"Conta desconectada com sucesso!","accounts.flash.connected":"Conta conectada com sucesso!","accounts.flash.session_expired":"Sessão expirada. Por favor, tente novamente.","accounts.flash.workspace_not_found":"Workspace não encontrado.","accounts.flash.already_connected":"Esta plataforma já está conectada.","accounts.flash.no_youtube_channels":"Nenhum canal do YouTube encontrado. Por favor, crie um canal primeiro.","auth.failed":"Essas credenciais não correspondem aos nossos registros.","auth.password":"A senha fornecida está incorreta.","auth.throttle":"Muitas tentativas de login. Por favor, tente novamente em :seconds segundos.","auth.flash.welcome":"Bem-vindo ao TryPost!","auth.flash.welcome_trial":"Bem-vindo ao TryPost! Seu período de teste começou.","auth.login.title":"Entrar na sua conta","auth.login.description":"Digite seu email e senha abaixo para entrar","auth.login.page_title":"Entrar","auth.login.email":"Endereço de email","auth.login.password":"Senha","auth.login.forgot_password":"Esqueceu a senha?","auth.login.remember_me":"Lembrar de mim","auth.login.submit":"Entrar","auth.login.no_account":"Não tem uma conta?","auth.login.sign_up":"Cadastre-se","auth.register.title":"Criar uma conta","auth.register.description":"Digite seus dados abaixo para criar sua conta","auth.register.page_title":"Cadastro","auth.register.name":"Nome","auth.register.name_placeholder":"Nome completo","auth.register.email":"Endereço de email","auth.register.password":"Senha","auth.register.submit":"Criar conta","auth.register.has_account":"Já tem uma conta?","auth.register.log_in":"Entrar","auth.forgot_password.title":"Esqueceu a senha","auth.forgot_password.description":"Digite seu email para receber um link de redefinição de senha","auth.forgot_password.page_title":"Esqueceu a senha","auth.forgot_password.email":"Endereço de email","auth.forgot_password.submit":"Enviar link de redefinição","auth.forgot_password.return_to":"Ou, volte para","auth.forgot_password.log_in":"entrar","auth.reset_password.title":"Redefinir senha","auth.reset_password.description":"Por favor, digite sua nova senha abaixo","auth.reset_password.page_title":"Redefinir senha","auth.reset_password.email":"Email","auth.reset_password.password":"Senha","auth.reset_password.confirm_password":"Confirmar Senha","auth.reset_password.confirm_placeholder":"Confirmar senha","auth.reset_password.submit":"Redefinir senha","auth.verify_email.title":"Verificar email","auth.verify_email.description":"Por favor, verifique seu endereço de email clicando no link que acabamos de enviar.","auth.verify_email.page_title":"Verificação de email","auth.verify_email.link_sent":"Um novo link de verificação foi enviado para o endereço de email que você forneceu durante o cadastro.","auth.verify_email.resend":"Reenviar email de verificação","auth.verify_email.log_out":"Sair","auth.accept_invite.page_title":"Aceitar Convite","auth.accept_invite.title":"Você foi convidado!","auth.accept_invite.description":"Você foi convidado para participar do workspace :workspace.","auth.accept_invite.workspace":"Workspace","auth.accept_invite.your_role":"Seu cargo","auth.accept_invite.email":"Email","auth.accept_invite.accept":"Aceitar Convite","auth.accept_invite.decline":"Recusar Convite","auth.accept_invite.login_prompt":"Entre ou crie uma conta para aceitar este convite.","auth.accept_invite.log_in":"Entrar","auth.accept_invite.create_account":"Criar Conta","billing.title":"Assinatura","billing.description":"Gerencie sua assinatura e método de pagamento","billing.trial.title":"Período de teste ativo","billing.trial.description":"Seu período de teste termina em :date. Após isso, sua assinatura será cobrada automaticamente.","billing.subscription.title":"Sua Assinatura","billing.subscription.workspaces":"Workspaces","billing.subscription.quantity":"Quantidade da assinatura","billing.subscription.expires":"Expira em :date","billing.subscription.canceled_on":"Sua assinatura será cancelada em :date","billing.subscription.manage":"Gerenciar no Stripe","billing.invoices.title":"Faturas","billing.invoices.description":"Histórico de pagamentos","billing.invoices.empty":"Nenhuma fatura encontrada","billing.invoices.paid":"Pago","billing.status.active":"Ativo","billing.status.canceled":"Cancelado","billing.status.incomplete":"Incompleto","billing.status.incomplete_expired":"Expirado","billing.status.past_due":"Vencido","billing.status.trialing":"Teste","billing.status.unpaid":"Não pago","calendar.title":"Calendário","calendar.today":"Hoje","calendar.day":"Dia","calendar.week":"Semana","calendar.month":"Mês","calendar.new_post":"Novo Post","calendar.no_content":"Sem conteúdo","calendar.more":"+:count mais","hashtags.title":"Hashtags","hashtags.description":"Crie grupos de hashtags para adicionar rapidamente aos seus posts","hashtags.new_group":"Novo Grupo","hashtags.no_groups_yet":"Nenhum grupo de hashtags ainda","hashtags.no_groups_description":"Crie grupos de hashtags para adicionar rapidamente hashtags populares aos seus posts","hashtags.create_first_group":"Crie seu primeiro grupo","hashtags.hashtags_count":":count hashtags","hashtags.create.title":"Criar Grupo de Hashtags","hashtags.create.description":"Dê um nome ao grupo e adicione hashtags separadas por espaços ou vírgulas","hashtags.create.name":"Nome do Grupo","hashtags.create.name_placeholder":"ex: Marketing, Viagem, Comida","hashtags.create.hashtags":"Hashtags","hashtags.create.hashtags_placeholder":"#marketing #redessociais #negocios #crescimento","hashtags.create.hashtags_hint":"Digite as hashtags separadas por espaços ou vírgulas. Inclua o símbolo #.","hashtags.create.submit":"Criar Grupo","hashtags.create.submitting":"Criando...","hashtags.edit.title":"Editar Grupo de Hashtags","hashtags.edit.description":"Atualize o nome e as hashtags deste grupo","hashtags.edit.name":"Nome do Grupo","hashtags.edit.name_placeholder":"ex: Marketing, Viagem, Comida","hashtags.edit.hashtags":"Hashtags","hashtags.edit.hashtags_placeholder":"#marketing #redessociais #negocios #crescimento","hashtags.edit.hashtags_hint":"Digite as hashtags separadas por espaços ou vírgulas. Inclua o símbolo #.","hashtags.edit.submit":"Salvar Alterações","hashtags.edit.submitting":"Salvando...","hashtags.delete.title":"Excluir Grupo de Hashtags","hashtags.delete.description":"Tem certeza que deseja excluir este grupo de hashtags? Esta ação não pode ser desfeita.","hashtags.delete.confirm":"Excluir","hashtags.delete.cancel":"Cancelar","hashtags.flash.created":"Grupo de hashtags criado com sucesso!","hashtags.flash.updated":"Grupo de hashtags atualizado com sucesso!","hashtags.flash.deleted":"Grupo de hashtags excluído com sucesso!","labels.title":"Etiquetas","labels.description":"Crie etiquetas para organizar e categorizar seus posts","labels.new_label":"Nova Etiqueta","labels.no_labels_yet":"Nenhuma etiqueta ainda","labels.create_first_label":"Crie sua primeira etiqueta","labels.create.title":"Criar Etiqueta","labels.create.description":"Dê um nome e escolha uma cor para sua etiqueta","labels.create.name":"Nome","labels.create.name_placeholder":"Digite o nome da etiqueta...","labels.create.color":"Cor","labels.create.submit":"Criar Etiqueta","labels.create.submitting":"Criando...","labels.edit.title":"Editar Etiqueta","labels.edit.description":"Atualize o nome e a cor desta etiqueta","labels.edit.name":"Nome","labels.edit.name_placeholder":"Digite o nome da etiqueta...","labels.edit.color":"Cor","labels.edit.submit":"Salvar Alterações","labels.edit.submitting":"Salvando...","labels.delete.title":"Excluir Etiqueta","labels.delete.description":"Tem certeza que deseja excluir esta etiqueta? Esta ação não pode ser desfeita.","labels.delete.confirm":"Excluir","labels.delete.cancel":"Cancelar","labels.flash.created":"Etiqueta criada com sucesso!","labels.flash.updated":"Etiqueta atualizada com sucesso!","labels.flash.deleted":"Etiqueta excluída com sucesso!","mail.workspace_connections_disconnected.subject":"{1} :count conta precisa ser reconectada em :workspace|[2,*] :count contas precisam ser reconectadas em :workspace","mail.workspace_connections_disconnected.title":"Contas Precisam ser Reconectadas","mail.workspace_connections_disconnected.intro":"As seguintes contas de redes sociais no seu workspace :workspace foram desconectadas e precisam ser reconectadas:","mail.workspace_connections_disconnected.reasons_title":"Isso pode ter acontecido porque:","mail.workspace_connections_disconnected.reason_expired":"Os tokens de acesso expiraram","mail.workspace_connections_disconnected.reason_revoked":"Você revogou o acesso ao TryPost na plataforma","mail.workspace_connections_disconnected.reason_changed":"A plataforma mudou os requisitos de autenticação","mail.workspace_connections_disconnected.reconnect_cta":"Por favor, reconecte essas contas para continuar agendando e publicando posts.","mail.workspace_connections_disconnected.button":"Reconectar Contas","pagination.previous":"« Anterior","pagination.next":"Próximo »","passwords.reset":"Sua senha foi redefinida.","passwords.sent":"Enviamos o link de redefinição de senha por e-mail.","passwords.throttled":"Por favor, aguarde antes de tentar novamente.","passwords.token":"Este token de redefinição de senha é inválido.","passwords.user":"Não conseguimos encontrar um usuário com esse endereço de e-mail.","posts.title":"Posts","posts.all_posts":"Todos os Posts","posts.new_post":"Novo Post","posts.no_posts":"Nenhum post encontrado","posts.start_creating":"Comece criando seu primeiro post.","posts.manage_posts":"Gerencie todos os seus posts","posts.delete_confirm":"Tem certeza que deseja excluir este post?","posts.by":"por","posts.actions.view":"Ver post","posts.actions.delete":"Excluir post","posts.form.post_type":"Tipo de Post","posts.form.board":"Pasta","posts.form.select_board":"Selecione uma pasta","posts.form.search_board":"Buscar pasta...","posts.form.no_board_found":"Nenhuma pasta encontrada","posts.form.media":"Mídia","posts.form.min":"Mín","posts.form.uploading":"Enviando...","posts.form.drop_to_upload":"Solte para enviar","posts.form.drag_and_drop":"Arraste e solte ou clique para enviar","posts.form.photos_and_videos":"Fotos e vídeos","posts.form.photos_only":"Apenas fotos","posts.form.videos_only":"Apenas vídeos","posts.form.drag_to_reorder":"Arraste para reordenar","posts.form.caption":"Legenda","posts.form.write_caption":"Escreva sua legenda...","posts.status.draft":"Rascunho","posts.status.scheduled":"Agendado","posts.status.publishing":"Publicando","posts.status.published":"Publicado","posts.status.partially_published":"Parcialmente Publicado","posts.status.failed":"Falhou","posts.descriptions.draft":"Posts aguardando agendamento","posts.descriptions.scheduled":"Posts agendados para publicação","posts.descriptions.published":"Posts já publicados","posts.edit.title":"Editar Post","posts.edit.view_title":"Visualizar Post","posts.edit.manage_platforms":"Gerenciar plataformas","posts.edit.sync":"Sincronizar","posts.edit.labels":"Etiquetas","posts.edit.hashtags":"Hashtags","posts.edit.schedule":"Agendar","posts.edit.publish":"Publicar","posts.edit.delete":"Excluir","posts.edit.settings":"Configurações","posts.edit.schedule_for":"Agendar para","posts.edit.saving":"Salvando...","posts.edit.saved":"Salvo","posts.edit.scheduled_at":"Agendado:","posts.edit.published_at":"Publicado:","posts.edit.media":"Mídia","posts.edit.caption":"Legenda","posts.edit.no_caption":"Sem legenda","posts.edit.no_content":"Sem conteúdo","posts.edit.empty_state.title":"Nenhuma plataforma selecionada","posts.edit.empty_state.description":"Selecione pelo menos uma plataforma para criar seu post","posts.edit.delete_modal.title":"Excluir Post","posts.edit.delete_modal.description":"Tem certeza que deseja excluir este post? Esta ação não pode ser desfeita.","posts.edit.delete_modal.action":"Excluir","posts.edit.delete_modal.cancel":"Cancelar","posts.edit.sync_enable.title":"Ativar sincronização?","posts.edit.sync_enable.description":"Todas as plataformas compartilharão o mesmo conteúdo. Qualquer edição personalizada feita em plataformas individuais será substituída pelo conteúdo atual.","posts.edit.sync_enable.cancel":"Cancelar","posts.edit.sync_enable.action":"Ativar sincronização","posts.edit.sync_disable.title":"Desativar sincronização?","posts.edit.sync_disable.description":"Cada plataforma manterá seu conteúdo atual, mas edições futuras serão aplicadas apenas à plataforma que você estiver editando.","posts.edit.sync_disable.customize_note":"Você poderá personalizar o conteúdo para cada plataforma individualmente.","posts.edit.sync_disable.cancel":"Cancelar","posts.edit.sync_disable.action":"Desativar sincronização","posts.edit.platforms_dialog.title":"Selecionar Plataformas","posts.edit.platforms_dialog.description":"Escolha em quais plataformas publicar este post.","posts.edit.hashtags_modal.search":"Buscar hashtags...","posts.edit.hashtags_modal.no_results":"Nenhuma hashtag encontrada.","posts.edit.validation.select_board":"Selecione uma pasta","posts.edit.validation.images_not_supported":"Imagens não suportadas","posts.edit.validation.videos_not_supported":"Vídeos não suportados","posts.edit.validation.max_images":"Máx :count imagens","posts.edit.validation.requires_media":"Requer mídia","posts.edit.validation.exceeded":":count excedido","posts.edit.validation.does_not_support_images":":platform não suporta imagens","posts.edit.validation.supports_up_to_images":":platform suporta até :count imagens","posts.edit.validation.does_not_support_videos":":platform não suporta vídeos","posts.content_types.instagram_feed.label":"Post do Feed","posts.content_types.instagram_feed.description":"Aparece no seu feed e perfil","posts.content_types.instagram_reel.label":"Reels","posts.content_types.instagram_reel.description":"Vídeo curto de até 90 segundos","posts.content_types.instagram_story.label":"Story","posts.content_types.instagram_story.description":"Desaparece após 24 horas","posts.content_types.linkedin_post.label":"Post","posts.content_types.linkedin_post.description":"Post padrão com texto e mídia","posts.content_types.linkedin_carousel.label":"Carrossel","posts.content_types.linkedin_carousel.description":"Imagens deslizáveis","posts.content_types.linkedin_page_post.label":"Post","posts.content_types.linkedin_page_post.description":"Post padrão com texto e mídia","posts.content_types.linkedin_page_carousel.label":"Carrossel","posts.content_types.linkedin_page_carousel.description":"Imagens deslizáveis","posts.content_types.facebook_post.label":"Post","posts.content_types.facebook_post.description":"Post padrão na sua página","posts.content_types.facebook_reel.label":"Reels","posts.content_types.facebook_reel.description":"Vídeo curto de até 90 segundos","posts.content_types.facebook_story.label":"Story","posts.content_types.facebook_story.description":"Desaparece após 24 horas","posts.content_types.tiktok_video.label":"Vídeo","posts.content_types.tiktok_video.description":"Conteúdo de vídeo curto","posts.content_types.youtube_short.label":"Short","posts.content_types.youtube_short.description":"Vídeo vertical de até 60 segundos","posts.content_types.x_post.label":"Post","posts.content_types.x_post.description":"Tweet com texto e mídia","posts.content_types.threads_post.label":"Post","posts.content_types.threads_post.description":"Post de texto com mídia opcional","posts.content_types.pinterest_pin.label":"Pin","posts.content_types.pinterest_pin.description":"Pin de imagem com link","posts.content_types.pinterest_video_pin.label":"Pin de Vídeo","posts.content_types.pinterest_video_pin.description":"Conteúdo em vídeo","posts.content_types.pinterest_carousel.label":"Carrossel","posts.content_types.pinterest_carousel.description":"2-5 imagens","posts.content_types.bluesky_post.label":"Post","posts.content_types.bluesky_post.description":"Post de texto com imagens opcionais","posts.content_types.mastodon_post.label":"Post","posts.content_types.mastodon_post.description":"Post de texto com mídia opcional","posts.platforms.linkedin":"LinkedIn","posts.platforms.linkedin-page":"Página do LinkedIn","posts.platforms.x":"X","posts.platforms.tiktok":"TikTok","posts.platforms.youtube":"YouTube Shorts","posts.platforms.facebook":"Página do Facebook","posts.platforms.instagram":"Instagram","posts.platforms.threads":"Threads","posts.platforms.pinterest":"Pinterest","posts.platforms.bluesky":"Bluesky","posts.platforms.mastodon":"Mastodon","posts.flash.scheduled":"Post agendado com sucesso!","posts.flash.publishing":"Post está sendo publicado!","posts.flash.deleted":"Post excluído com sucesso!","posts.flash.cannot_edit_published":"Posts publicados não podem ser editados.","posts.flash.connect_first":"Conecte pelo menos uma rede social antes de criar um post.","posts.errors.account_disconnected":"Conta social está desconectada","settings.title":"Configurações","settings.description":"Gerencie seu perfil e configurações da conta","settings.nav.profile":"Perfil","settings.nav.password":"Senha","settings.nav.workspace":"Workspace","settings.nav.members":"Membros","settings.nav.billing":"Faturamento","settings.profile.title":"Configurações do perfil","settings.profile.heading":"Informações do perfil","settings.profile.description":"Atualize seu nome e endereço de e-mail","settings.profile.avatar":"Avatar","settings.profile.name":"Nome","settings.profile.name_placeholder":"Nome completo","settings.profile.email":"Endereço de e-mail","settings.profile.email_placeholder":"Endereço de e-mail","settings.profile.email_unverified":"Seu endereço de e-mail não foi verificado.","settings.profile.resend_verification":"Clique aqui para reenviar o e-mail de verificação.","settings.profile.verification_sent":"Um novo link de verificação foi enviado para seu endereço de e-mail.","settings.profile.save":"Salvar","settings.password.title":"Configurações de senha","settings.password.heading":"Atualizar senha","settings.password.description":"Certifique-se de que sua conta esteja usando uma senha longa e aleatória para se manter seguro","settings.password.current_password":"Senha atual","settings.password.current_password_placeholder":"Senha atual","settings.password.new_password":"Nova senha","settings.password.new_password_placeholder":"Nova senha","settings.password.confirm_password":"Confirmar senha","settings.password.confirm_password_placeholder":"Confirmar senha","settings.password.save":"Salvar senha","settings.delete_account.heading":"Excluir conta","settings.delete_account.description":"Exclua sua conta e todos os seus recursos","settings.delete_account.warning":"Atenção","settings.delete_account.warning_message":"Por favor, prossiga com cuidado, isso não pode ser desfeito.","settings.delete_account.button":"Excluir conta","settings.delete_account.modal_title":"Tem certeza que deseja excluir sua conta?","settings.delete_account.modal_description":"Uma vez que sua conta for excluída, todos os seus recursos e dados também serão permanentemente excluídos. Por favor, digite sua senha para confirmar que deseja excluir permanentemente sua conta.","settings.delete_account.password":"Senha","settings.delete_account.password_placeholder":"Senha","settings.delete_account.cancel":"Cancelar","settings.delete_account.confirm":"Excluir conta","settings.workspace.title":"Configurações do workspace","settings.workspace.heading":"Configurações do workspace","settings.workspace.description":"Atualize o nome, logo e fuso horário do workspace","settings.workspace.logo":"Logo","settings.workspace.name":"Nome","settings.workspace.name_placeholder":"Meu Workspace","settings.workspace.timezone":"Fuso horário","settings.workspace.save":"Salvar","settings.workspace.saved":"Salvo.","settings.members.title":"Membros","settings.members.heading":"Membros da equipe","settings.members.description":"Gerencie membros e convites deste workspace","settings.members.invite.title":"Convidar Membro","settings.members.invite.description":"Envie um convite por e-mail para adicionar colaboradores","settings.members.invite.email":"E-mail","settings.members.invite.email_placeholder":"colaborador@email.com","settings.members.invite.role":"Função","settings.members.invite.role_placeholder":"Selecione uma função","settings.members.invite.submit":"Enviar Convite","settings.members.invite.cancel_confirm":"Tem certeza que deseja cancelar este convite?","settings.members.pending.title":"Convites Pendentes","settings.members.pending.description":"Convites aguardando aceitação","settings.members.pending.empty":"Nenhum convite pendente","settings.members.list.title":"Membros","settings.members.list.description":"Pessoas com acesso a este workspace","settings.members.list.empty":"Nenhum membro além do proprietário","settings.members.list.remove_confirm":"Tem certeza que deseja remover este membro?","settings.members.roles.owner":"Proprietário","settings.members.roles.admin":"Administrador","settings.members.roles.member":"Membro","settings.members.flash.invite_sent":"Convite enviado com sucesso!","settings.members.flash.invite_deleted":"Convite excluído.","settings.members.flash.member_removed":"Membro removido com sucesso.","settings.members.flash.wrong_email":"Este convite é para um endereço de e-mail diferente.","settings.members.flash.already_member":"Você já é membro deste workspace.","settings.members.flash.invite_accepted":"Bem-vindo! Você agora é membro do workspace.","settings.members.flash.invite_declined":"Convite recusado.","settings.flash.profile_updated":"Perfil atualizado com sucesso!","settings.flash.language_updated":"Idioma atualizado com sucesso!","settings.flash.password_updated":"Senha atualizada com sucesso!","settings.flash.workspace_updated":"Configurações atualizadas com sucesso!","sidebar.select_workspace":"Selecionar workspace","sidebar.create_workspace":"Criar workspace","sidebar.create_post":"Novo post","sidebar.profile":"Perfil","sidebar.log_out":"Sair","sidebar.workspace":"Workspace: :name","sidebar.workspace_select":"Workspace: Selecionar","sidebar.theme":"Tema: :name","sidebar.theme_light":"Claro","sidebar.theme_dark":"Escuro","sidebar.theme_system":"Sistema","sidebar.language":"Idioma: :name","sidebar.language_select":"Idioma: Selecionar","sidebar.groups.posts":"Posts","sidebar.groups.configuration":"Configurações","sidebar.groups.support":"Suporte","sidebar.posts.calendar":"Calendário","sidebar.posts.all":"Todos","sidebar.posts.scheduled":"Agendados","sidebar.posts.posted":"Publicados","sidebar.posts.drafts":"Rascunhos","sidebar.config.connections":"Conexões","sidebar.config.hashtags":"Hashtags","sidebar.config.labels":"Etiquetas","sidebar.config.settings":"Configurações","sidebar.support.discord":"Discord","sidebar.support.share_feedback":"Enviar feedback","sidebar.support.last_updates":"Últimas Atualizações","sidebar.support.docs":"Documentação","validation.accepted":"O campo :attribute deve ser aceito.","validation.accepted_if":"O campo :attribute deve ser aceito quando :other for :value.","validation.active_url":"O campo :attribute deve ser uma URL válida.","validation.after":"O campo :attribute deve ser uma data posterior a :date.","validation.after_or_equal":"O campo :attribute deve ser uma data posterior ou igual a :date.","validation.alpha":"O campo :attribute deve conter apenas letras.","validation.alpha_dash":"O campo :attribute deve conter apenas letras, números, hifens e underscores.","validation.alpha_num":"O campo :attribute deve conter apenas letras e números.","validation.any_of":"O campo :attribute é inválido.","validation.array":"O campo :attribute deve ser um array.","validation.ascii":"O campo :attribute deve conter apenas caracteres alfanuméricos e símbolos de um byte.","validation.before":"O campo :attribute deve ser uma data anterior a :date.","validation.before_or_equal":"O campo :attribute deve ser uma data anterior ou igual a :date.","validation.between.array":"O campo :attribute deve ter entre :min e :max itens.","validation.between.file":"O campo :attribute deve estar entre :min e :max kilobytes.","validation.between.numeric":"O campo :attribute deve estar entre :min e :max.","validation.between.string":"O campo :attribute deve estar entre :min e :max caracteres.","validation.boolean":"O campo :attribute deve ser verdadeiro ou falso.","validation.can":"O campo :attribute contém um valor não autorizado.","validation.confirmed":"A confirmação do campo :attribute não corresponde.","validation.contains":"O campo :attribute está faltando um valor obrigatório.","validation.current_password":"A senha está incorreta.","validation.date":"O campo :attribute deve ser uma data válida.","validation.date_equals":"O campo :attribute deve ser uma data igual a :date.","validation.date_format":"O campo :attribute deve corresponder ao formato :format.","validation.decimal":"O campo :attribute deve ter :decimal casas decimais.","validation.declined":"O campo :attribute deve ser recusado.","validation.declined_if":"O campo :attribute deve ser recusado quando :other for :value.","validation.different":"O campo :attribute e :other devem ser diferentes.","validation.digits":"O campo :attribute deve ter :digits dígitos.","validation.digits_between":"O campo :attribute deve ter entre :min e :max dígitos.","validation.dimensions":"O campo :attribute deve ter dimensões de imagem válidas.","validation.distinct":"O campo :attribute tem um valor duplicado.","validation.doesnt_contain":"O campo :attribute não deve conter nenhum dos seguintes: :values.","validation.doesnt_end_with":"O campo :attribute não deve terminar com nenhum dos seguintes: :values.","validation.doesnt_start_with":"O campo :attribute não deve começar com nenhum dos seguintes: :values.","validation.email":"O campo :attribute deve ser um endereço de e-mail válido.","validation.encoding":"O campo :attribute deve ser codificado em :encoding.","validation.ends_with":"O campo :attribute deve terminar com um dos seguintes: :values.","validation.enum":"O :attribute selecionado é inválido.","validation.exists":"O :attribute selecionado é inválido.","validation.extensions":"O campo :attribute deve ter uma das seguintes extensões: :values.","validation.file":"O campo :attribute deve ser um arquivo.","validation.filled":"O campo :attribute deve ter um valor.","validation.gt.array":"O campo :attribute deve ter mais de :value itens.","validation.gt.file":"O campo :attribute deve ser maior que :value kilobytes.","validation.gt.numeric":"O campo :attribute deve ser maior que :value.","validation.gt.string":"O campo :attribute deve ser maior que :value caracteres.","validation.gte.array":"O campo :attribute deve ter :value itens ou mais.","validation.gte.file":"O campo :attribute deve ser maior ou igual a :value kilobytes.","validation.gte.numeric":"O campo :attribute deve ser maior ou igual a :value.","validation.gte.string":"O campo :attribute deve ser maior ou igual a :value caracteres.","validation.hex_color":"O campo :attribute deve ser uma cor hexadecimal válida.","validation.image":"O campo :attribute deve ser uma imagem.","validation.in":"O :attribute selecionado é inválido.","validation.in_array":"O campo :attribute deve existir em :other.","validation.in_array_keys":"O campo :attribute deve conter pelo menos uma das seguintes chaves: :values.","validation.integer":"O campo :attribute deve ser um inteiro.","validation.ip":"O campo :attribute deve ser um endereço IP válido.","validation.ipv4":"O campo :attribute deve ser um endereço IPv4 válido.","validation.ipv6":"O campo :attribute deve ser um endereço IPv6 válido.","validation.json":"O campo :attribute deve ser uma string JSON válida.","validation.list":"O campo :attribute deve ser uma lista.","validation.lowercase":"O campo :attribute deve estar em minúsculas.","validation.lt.array":"O campo :attribute deve ter menos de :value itens.","validation.lt.file":"O campo :attribute deve ser menor que :value kilobytes.","validation.lt.numeric":"O campo :attribute deve ser menor que :value.","validation.lt.string":"O campo :attribute deve ser menor que :value caracteres.","validation.lte.array":"O campo :attribute deve ter :value itens ou menos.","validation.lte.file":"O campo :attribute deve ser menor ou igual a :value kilobytes.","validation.lte.numeric":"O campo :attribute deve ser menor ou igual a :value.","validation.lte.string":"O campo :attribute deve ser menor ou igual a :value caracteres.","validation.mac_address":"O campo :attribute deve ser um endereço MAC válido.","validation.max.array":"O campo :attribute deve ter no máximo :max itens.","validation.max.file":"O campo :attribute deve ter no máximo :max kilobytes.","validation.max.numeric":"O campo :attribute deve ter no máximo :max.","validation.max.string":"O campo :attribute deve ter no máximo :max caracteres.","validation.max_digits":"O campo :attribute não deve ter mais que :max dígitos.","validation.mimes":"O campo :attribute deve ser um arquivo do tipo: :values.","validation.mimetypes":"O campo :attribute deve ser um arquivo do tipo: :values.","validation.min.array":"O campo :attribute deve ter pelo menos :min itens.","validation.min.file":"O campo :attribute deve ter pelo menos :min kilobytes.","validation.min.numeric":"O campo :attribute deve ter pelo menos :min.","validation.min.string":"O campo :attribute deve ter pelo menos :min caracteres.","validation.min_digits":"O campo :attribute deve ter pelo menos :min dígitos.","validation.missing":"O campo :attribute deve estar ausente.","validation.missing_if":"O campo :attribute deve estar ausente quando :other for :value.","validation.missing_unless":"O campo :attribute deve estar ausente a menos que :other seja :value.","validation.missing_with":"O campo :attribute deve estar ausente quando :values estiver presente.","validation.missing_with_all":"O campo :attribute deve estar ausente quando :values estiverem presentes.","validation.multiple_of":"O campo :attribute deve ser um múltiplo de :value.","validation.not_in":"O :attribute selecionado é inválido.","validation.not_regex":"O formato do campo :attribute é inválido.","validation.numeric":"O campo :attribute deve ser um número.","validation.password.letters":"O campo :attribute deve conter pelo menos uma letra.","validation.password.mixed":"O campo :attribute deve conter pelo menos uma letra maiúscula e uma minúscula.","validation.password.numbers":"O campo :attribute deve conter pelo menos um número.","validation.password.symbols":"O campo :attribute deve conter pelo menos um símbolo.","validation.password.uncompromised":"O :attribute fornecido apareceu em um vazamento de dados. Por favor, escolha um :attribute diferente.","validation.present":"O campo :attribute deve estar presente.","validation.present_if":"O campo :attribute deve estar presente quando :other for :value.","validation.present_unless":"O campo :attribute deve estar presente a menos que :other seja :value.","validation.present_with":"O campo :attribute deve estar presente quando :values estiver presente.","validation.present_with_all":"O campo :attribute deve estar presente quando :values estiverem presentes.","validation.prohibited":"O campo :attribute é proibido.","validation.prohibited_if":"O campo :attribute é proibido quando :other for :value.","validation.prohibited_if_accepted":"O campo :attribute é proibido quando :other for aceito.","validation.prohibited_if_declined":"O campo :attribute é proibido quando :other for recusado.","validation.prohibited_unless":"O campo :attribute é proibido a menos que :other esteja em :values.","validation.prohibits":"O campo :attribute proíbe :other de estar presente.","validation.regex":"O formato do campo :attribute é inválido.","validation.required":"O campo :attribute é obrigatório.","validation.required_array_keys":"O campo :attribute deve conter entradas para: :values.","validation.required_if":"O campo :attribute é obrigatório quando :other for :value.","validation.required_if_accepted":"O campo :attribute é obrigatório quando :other for aceito.","validation.required_if_declined":"O campo :attribute é obrigatório quando :other for recusado.","validation.required_unless":"O campo :attribute é obrigatório a menos que :other esteja em :values.","validation.required_with":"O campo :attribute é obrigatório quando :values estiver presente.","validation.required_with_all":"O campo :attribute é obrigatório quando :values estiverem presentes.","validation.required_without":"O campo :attribute é obrigatório quando :values não estiver presente.","validation.required_without_all":"O campo :attribute é obrigatório quando nenhum dos :values estiver presente.","validation.same":"O campo :attribute deve ser igual a :other.","validation.size.array":"O campo :attribute deve conter :size itens.","validation.size.file":"O campo :attribute deve ter :size kilobytes.","validation.size.numeric":"O campo :attribute deve ser :size.","validation.size.string":"O campo :attribute deve ter :size caracteres.","validation.starts_with":"O campo :attribute deve começar com um dos seguintes: :values.","validation.string":"O campo :attribute deve ser uma string.","validation.timezone":"O campo :attribute deve ser um fuso horário válido.","validation.unique":"O :attribute já foi utilizado.","validation.uploaded":"O :attribute falhou ao ser enviado.","validation.uppercase":"O campo :attribute deve estar em maiúsculo.","validation.url":"O campo :attribute deve ser uma URL válida.","validation.ulid":"O campo :attribute deve ser um ULID válido.","validation.uuid":"O campo :attribute deve ser um UUID válido.","validation.custom.attribute-name.rule-name":"custom-message"} \ No newline at end of file diff --git a/resources/css/app.css b/resources/css/app.css index 86d315e7..1306e9e9 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,129 +1,146 @@ @import 'tailwindcss'; - @import 'tw-animate-css'; - +@import 'vue-sonner/style.css'; @source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; @source '../../storage/framework/views/*.php'; - @custom-variant dark (&:is(.dark *)); -@layer utilities { - - body, - html { - --font-sans: - 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, - 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', - 'Noto Color Emoji'; - } -} - :root { - --background: #f7f9f3; - --foreground: #000000; + --background: #fafafa; + --foreground: #0a0a0a; --card: #ffffff; - --card-foreground: #000000; + --card-foreground: #0a0a0a; --popover: #ffffff; - --popover-foreground: #000000; - --primary: #4f46e5; - --primary-foreground: #ffffff; - --secondary: #14b8a6; - --secondary-foreground: #ffffff; - --muted: #f0f0f0; - --muted-foreground: #333333; - --accent: #f59e0b; - --accent-foreground: #000000; - --destructive: #ef4444; - --destructive-foreground: #ffffff; - --border: #000000; - --input: #737373; - --ring: #a5b4fc; - --chart-1: #4f46e5; - --chart-2: #14b8a6; - --chart-3: #f59e0b; - --chart-4: #ec4899; - --chart-5: #22c55e; - --sidebar: #f7f9f3; - --sidebar-foreground: #000000; - --sidebar-primary: #4f46e5; - --sidebar-primary-foreground: #ffffff; - --sidebar-accent: #f59e0b; - --sidebar-accent-foreground: #000000; - --sidebar-border: #000000; - --sidebar-ring: #a5b4fc; - --font-sans: DM Sans, sans-serif; - --font-serif: DM Sans, sans-serif; - --font-mono: Space Mono, monospace; - --radius: 1rem; - --shadow-x: 0px; - --shadow-y: 0px; - --shadow-blur: 0px; + --popover-foreground: #0a0a0a; + --primary: #171717; + --primary-foreground: #fafafa; + --secondary: #e5e5e5; + --secondary-foreground: #171717; + --muted: #f5f5f5; + --muted-foreground: #737373; + --accent: #e5e5e5; + --accent-foreground: #171717; + --destructive: #dc2626; + --destructive-foreground: #fafafa; + --success: #16a34a; + --error: #dc2626; + --warning: #d97706; + --info: #2563eb; + --border: #e5e5e5; + --input: #d4d4d4; + --ring: #525252; + --chart-1: #1f3fad; + --chart-2: #1a4eda; + --chart-3: #2563ef; + --chart-4: #3a81f6; + --chart-5: #91c5ff; + --sidebar: #f5f5f5; + --sidebar-foreground: #0a0a0a; + --sidebar-primary: #1447e6; + --sidebar-primary-foreground: #fafafa; + --sidebar-accent: #e5e5e5; + --sidebar-accent-foreground: #171717; + --sidebar-border: #e5e5e5; + --sidebar-ring: #a3a3a3; + --font-sans: + 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, + BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', + 'Segoe UI Symbol', 'Noto Color Emoji'; + --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif; + --font-mono: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + 'Liberation Mono', 'Courier New', monospace; + --radius: 0.725rem; + --shadow-x: 0; + --shadow-y: 1px; + --shadow-blur: 2.5px; --shadow-spread: 0px; - --shadow-opacity: 0.05; - --shadow-color: #1a1a1a; - --shadow-2xs: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.03); - --shadow-xs: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.03); - --shadow-sm: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 1px 2px -1px hsl(0 0% 10.1961% / 0.05); - --shadow: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 1px 2px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-md: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 2px 4px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-lg: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 4px 6px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-xl: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 8px 10px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-2xl: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.13); - --tracking-normal: normal; + --shadow-opacity: 0.04; + --shadow-color: oklch(0.3065 0.0243 243.82); + --shadow-2xs: 0 1px 2.5px 0px hsl(0 0% 0% / 0.02); + --shadow-xs: 0 1px 2.5px 0px hsl(0 0% 0% / 0.02); + --shadow-sm: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 1px 2px -1px hsl(0 0% 0% / 0.04); + --shadow: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 1px 2px -1px hsl(0 0% 0% / 0.04); + --shadow-md: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 2px 4px -1px hsl(0 0% 0% / 0.04); + --shadow-lg: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 4px 6px -1px hsl(0 0% 0% / 0.04); + --shadow-xl: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 8px 10px -1px hsl(0 0% 0% / 0.04); + --shadow-2xl: 0 1px 2.5px 0px hsl(0 0% 0% / 0.1); + --tracking-normal: 0em; --spacing: 0.25rem; } .dark { - --background: #000000; - --foreground: #ffffff; - --card: #1a212b; - --card-foreground: #ffffff; - --popover: #1a212b; - --popover-foreground: #ffffff; - --primary: #818cf8; - --primary-foreground: #000000; - --secondary: #2dd4bf; - --secondary-foreground: #000000; - --muted: #333333; - --muted-foreground: #cccccc; - --accent: #fcd34d; - --accent-foreground: #000000; - --destructive: #f87171; - --destructive-foreground: #000000; - --border: #545454; - --input: #ffffff; - --ring: #818cf8; - --chart-1: #818cf8; - --chart-2: #2dd4bf; - --chart-3: #fcd34d; - --chart-4: #f472b6; - --chart-5: #4ade80; - --sidebar: #000000; - --sidebar-foreground: #ffffff; - --sidebar-primary: #818cf8; - --sidebar-primary-foreground: #000000; - --sidebar-accent: #fcd34d; - --sidebar-accent-foreground: #000000; - --sidebar-border: #ffffff; - --sidebar-ring: #818cf8; - --font-sans: DM Sans, sans-serif; - --font-serif: DM Sans, sans-serif; - --font-mono: Space Mono, monospace; - --radius: 1rem; - --shadow-x: 0px; - --shadow-y: 0px; - --shadow-blur: 0px; + --background: #0a0a0a; + --foreground: #fafafa; + --card: #171717; + --card-foreground: #fafafa; + --popover: #262626; + --popover-foreground: #fafafa; + --primary: #e5e5e5; + --primary-foreground: #171717; + --secondary: #262626; + --secondary-foreground: #fafafa; + --muted: #262626; + --muted-foreground: #a1a1a1; + --accent: #404040; + --accent-foreground: #fafafa; + --destructive: #ff6467; + --destructive-foreground: #fafafa; + --success: #16a34a; + --error: #dc2626; + --warning: #d97706; + --info: #2563eb; + --border: #333333; + --input: #343434; + --ring: #737373; + --chart-1: #91c5ff; + --chart-2: #3a81f6; + --chart-3: #2563ef; + --chart-4: #1a4eda; + --chart-5: #1f3fad; + --sidebar: #171717; + --sidebar-foreground: #fafafa; + --sidebar-primary: #1447e6; + --sidebar-primary-foreground: #fafafa; + --sidebar-accent: #262626; + --sidebar-accent-foreground: #fafafa; + --sidebar-border: #282828; + --sidebar-ring: #525252; + --font-sans: + 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, + BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, + 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', + 'Segoe UI Symbol', 'Noto Color Emoji'; + --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif; + --font-mono: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + 'Liberation Mono', 'Courier New', monospace; + --radius: 0.725rem; + --shadow-x: 0; + --shadow-y: 1px; + --shadow-blur: 2.5px; --shadow-spread: 0px; - --shadow-opacity: 0.05; - --shadow-color: #1a1a1a; - --shadow-2xs: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.03); - --shadow-xs: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.03); - --shadow-sm: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 1px 2px -1px hsl(0 0% 10.1961% / 0.05); - --shadow: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 1px 2px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-md: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 2px 4px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-lg: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 4px 6px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-xl: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.05), 0px 8px 10px -1px hsl(0 0% 10.1961% / 0.05); - --shadow-2xl: 0px 0px 0px 0px hsl(0 0% 10.1961% / 0.13); + --shadow-opacity: 0.04; + --shadow-color: oklch(0 0 0); + --shadow-2xs: 0 1px 2.5px 0px hsl(0 0% 0% / 0.02); + --shadow-xs: 0 1px 2.5px 0px hsl(0 0% 0% / 0.02); + --shadow-sm: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 1px 2px -1px hsl(0 0% 0% / 0.04); + --shadow: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 1px 2px -1px hsl(0 0% 0% / 0.04); + --shadow-md: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 2px 4px -1px hsl(0 0% 0% / 0.04); + --shadow-lg: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 4px 6px -1px hsl(0 0% 0% / 0.04); + --shadow-xl: + 0 1px 2.5px 0px hsl(0 0% 0% / 0.04), 0 8px 10px -1px hsl(0 0% 0% / 0.04); + --shadow-2xl: 0 1px 2.5px 0px hsl(0 0% 0% / 0.1); } @theme inline { @@ -177,17 +194,6 @@ @theme inline { --shadow-lg: var(--shadow-lg); --shadow-xl: var(--shadow-xl); --shadow-2xl: var(--shadow-2xl); - - --tracking-tighter: calc(var(--tracking-normal) - 0.05em); - --tracking-tight: calc(var(--tracking-normal) - 0.025em); - --tracking-normal: var(--tracking-normal); - --tracking-wide: calc(var(--tracking-normal) + 0.025em); - --tracking-wider: calc(var(--tracking-normal) + 0.05em); - --tracking-widest: calc(var(--tracking-normal) + 0.1em); -} - -body { - letter-spacing: var(--tracking-normal); } @layer base { @@ -198,4 +204,49 @@ @layer base { body { @apply bg-background text-foreground; } +} + +.workflow-dots { + background-image: radial-gradient(circle, + var(--border) 1px, + transparent 1px); + background-size: 20px 20px; + cursor: grab; +} + +.workflow-dots:active { + cursor: grabbing; +} + +/* Animated dashed connector lines */ +.workflow-line-v { + width: 2px; + background: repeating-linear-gradient(to bottom, + var(--border) 0, + var(--border) 4px, + transparent 4px, + transparent 8px); + animation: march-v 0.5s linear infinite; +} + +.workflow-line-h { + height: 2px; + background: repeating-linear-gradient(to right, + var(--border) 0, + var(--border) 4px, + transparent 4px, + transparent 8px); + animation: march-h 0.5s linear infinite; +} + +@keyframes march-v { + to { + background-position-y: 8px; + } +} + +@keyframes march-h { + to { + background-position-x: 8px; + } } \ No newline at end of file diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vue index da375dde..b3524906 100644 --- a/resources/js/components/AppSidebar.vue +++ b/resources/js/components/AppSidebar.vue @@ -1,47 +1,53 @@ \ No newline at end of file + diff --git a/resources/js/components/AppSidebarHeader.vue b/resources/js/components/AppSidebarHeader.vue index 29ae7e9b..2f9861ff 100644 --- a/resources/js/components/AppSidebarHeader.vue +++ b/resources/js/components/AppSidebarHeader.vue @@ -1,11 +1,11 @@ diff --git a/resources/js/pages/settings/Workspace.vue b/resources/js/pages/settings/Workspace.vue index cc38751b..6b2158df 100644 --- a/resources/js/pages/settings/Workspace.vue +++ b/resources/js/pages/settings/Workspace.vue @@ -1,19 +1,55 @@ diff --git a/resources/js/types/index.d.ts b/resources/js/types/index.d.ts index 00f6fe8c..5afe4798 100644 --- a/resources/js/types/index.d.ts +++ b/resources/js/types/index.d.ts @@ -34,11 +34,13 @@ export interface User { id: number; name: string; email: string; - avatar?: string; + has_photo: boolean; + photo_url: string | null; + locale: string; email_verified_at: string | null; created_at: string; updated_at: string; - [key: string]: unknown; // This allows for additional properties... + [key: string]: unknown; } export type BreadcrumbItemType = BreadcrumbItem; diff --git a/routes/app.php b/routes/app.php index aaaa9787..a1799a6e 100644 --- a/routes/app.php +++ b/routes/app.php @@ -136,7 +136,7 @@ function () { Route::delete('medias/{modelId}/{media}', [MediaController::class, 'destroy'])->name('app.medias.destroy'); // Members - Route::get('settings/members', [WorkspaceInviteController::class, 'index'])->name('app.members'); + Route::get('settings/members', fn () => redirect()->route('app.workspace.settings'))->name('app.members'); Route::post('settings/members/invites', [WorkspaceInviteController::class, 'store'])->name('app.invites.store'); Route::delete('settings/members/invites/{invite}', [WorkspaceInviteController::class, 'destroy'])->name('app.invites.destroy'); Route::delete('settings/members/{user}', [WorkspaceInviteController::class, 'removeMember'])->name('app.members.remove'); diff --git a/routes/channels.php b/routes/channels.php index c2d2889a..fb56c457 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -1,5 +1,7 @@ create(['code' => 'en']); $this->owner = User::factory()->create(['setup' => Setup::Completed]); $this->workspace = Workspace::factory()->create(['user_id' => $this->owner->id]); }); diff --git a/tests/Feature/Api/ApiKeyApiTest.php b/tests/Feature/Api/ApiKeyApiTest.php index c9731997..b0d61359 100644 --- a/tests/Feature/Api/ApiKeyApiTest.php +++ b/tests/Feature/Api/ApiKeyApiTest.php @@ -1,5 +1,7 @@ shouldReceive('publish')->andThrow(new TokenExpiredException('Token expired', 401)); + $publisher->shouldReceive('publish')->andThrow(new TokenExpiredException('Token expired', '401')); $this->app->instance(LinkedInPublisher::class, $publisher); diff --git a/tests/Feature/Listeners/StripeEventListenerTest.php b/tests/Feature/Listeners/StripeEventListenerTest.php index 8e9f00ab..fbc3f72a 100644 --- a/tests/Feature/Listeners/StripeEventListenerTest.php +++ b/tests/Feature/Listeners/StripeEventListenerTest.php @@ -1,5 +1,7 @@ refresh()->email_verified_at)->not->toBeNull(); }); -test('user can update their language', function () { +test('user can update their locale', function () { $user = User::factory()->create(); - $newLanguage = Language::factory()->create(); $response = $this ->actingAs($user) ->from(route('app.posts.index')) ->patch(route('app.profile.language'), [ - 'language_id' => $newLanguage->id, + 'locale' => 'es', ]); $response ->assertSessionHasNoErrors() ->assertRedirect(route('app.posts.index')); - expect($user->refresh()->language_id)->toBe($newLanguage->id); + expect($user->refresh()->locale)->toBe('es'); }); -test('user cannot update language with invalid language id', function () { +test('user cannot update locale with invalid code', function () { $user = User::factory()->create(); $response = $this ->actingAs($user) ->patch(route('app.profile.language'), [ - 'language_id' => '00000000-0000-0000-0000-000000000000', + 'locale' => 'invalid', ]); - $response->assertSessionHasErrors('language_id'); + $response->assertSessionHasErrors('locale'); }); test('user can delete their account', function () { diff --git a/tests/Feature/Social/BlueskyControllerTest.php b/tests/Feature/Social/BlueskyControllerTest.php index 6c79192d..d95f36b9 100644 --- a/tests/Feature/Social/BlueskyControllerTest.php +++ b/tests/Feature/Social/BlueskyControllerTest.php @@ -1,5 +1,7 @@ user = User::factory()->create(['setup' => Setup::Completed]); @@ -162,7 +165,7 @@ $response->assertRedirect(route('login')); }); -test('workspace settings shows settings page', function () { +test('workspace settings shows settings page with members and invitations', function () { $response = $this->actingAs($this->user)->get(route('app.workspace.settings')); $response->assertOk(); @@ -170,6 +173,8 @@ ->component('settings/Workspace', false) ->has('workspace') ->has('timezones') + ->has('members') + ->has('invitations') ); }); @@ -222,6 +227,85 @@ $response->assertSessionHasErrors('timezone'); }); +// Logo upload tests +test('upload workspace logo requires authentication', function () { + $response = $this->post(route('app.workspace.upload-logo'), [ + 'photo' => UploadedFile::fake()->image('logo.jpg'), + ]); + + $response->assertRedirect(route('login')); +}); + +test('upload workspace logo succeeds with valid image', function () { + $response = $this->actingAs($this->user)->post(route('app.workspace.upload-logo'), [ + 'photo' => UploadedFile::fake()->image('logo.jpg', 200, 200), + ]); + + $response->assertRedirect(); + + $this->workspace->refresh(); + expect($this->workspace->has_logo)->toBeTrue(); + expect($this->workspace->logo_url)->not->toBeNull(); +}); + +test('upload workspace logo validates file is an image', function () { + $response = $this->actingAs($this->user)->post(route('app.workspace.upload-logo'), [ + 'photo' => UploadedFile::fake()->create('document.pdf', 100), + ]); + + $response->assertSessionHasErrors('photo'); +}); + +test('upload workspace logo validates max size', function () { + $response = $this->actingAs($this->user)->post(route('app.workspace.upload-logo'), [ + 'photo' => UploadedFile::fake()->image('logo.jpg')->size(3000), + ]); + + $response->assertSessionHasErrors('photo'); +}); + +test('upload workspace logo requires authorization', function () { + $otherUser = User::factory()->create(['setup' => Setup::Completed]); + + $response = $this->actingAs($otherUser)->post(route('app.workspace.upload-logo'), [ + 'photo' => UploadedFile::fake()->image('logo.jpg'), + ]); + + $response->assertForbidden(); +}); + +test('delete workspace logo requires authentication', function () { + $response = $this->delete(route('app.workspace.delete-logo')); + + $response->assertRedirect(route('login')); +}); + +test('delete workspace logo succeeds', function () { + // Upload first + $this->actingAs($this->user)->post(route('app.workspace.upload-logo'), [ + 'photo' => UploadedFile::fake()->image('logo.jpg', 200, 200), + ]); + + $this->workspace->refresh(); + expect($this->workspace->has_logo)->toBeTrue(); + + // Delete + $response = $this->actingAs($this->user)->delete(route('app.workspace.delete-logo')); + + $response->assertRedirect(); + + $this->workspace->refresh(); + expect($this->workspace->has_logo)->toBeFalse(); +}); + +test('delete workspace logo requires authorization', function () { + $otherUser = User::factory()->create(['setup' => Setup::Completed]); + + $response = $this->actingAs($otherUser)->delete(route('app.workspace.delete-logo')); + + $response->assertForbidden(); +}); + // Destroy tests test('destroy workspace requires authentication', function () { $response = $this->delete(route('app.workspaces.destroy', $this->workspace)); diff --git a/tests/Feature/WorkspaceHashtagControllerTest.php b/tests/Feature/WorkspaceHashtagControllerTest.php index 3f41a79d..79c45f3d 100644 --- a/tests/Feature/WorkspaceHashtagControllerTest.php +++ b/tests/Feature/WorkspaceHashtagControllerTest.php @@ -1,5 +1,7 @@ assertRedirect(route('login')); }); -test('members index shows members and invites', function () { +test('members index redirects to workspace settings', function () { + $response = $this->actingAs($this->user)->get(route('app.members')); + + $response->assertRedirect(route('app.workspace.settings')); +}); + +test('workspace settings shows members and invites', function () { $invite = WorkspaceInvite::factory()->create([ 'workspace_id' => $this->workspace->id, ]); - $response = $this->actingAs($this->user)->get(route('app.members')); + $response = $this->actingAs($this->user)->get(route('app.workspace.settings')); $response->assertOk(); $response->assertInertia(fn ($page) => $page - ->component('settings/Members', false) + ->component('settings/Workspace', false) ->has('workspace') - ->has('invites') ->has('members') - ->has('owner') - ->has('roles') + ->has('invitations') + ->has('timezones') ); }); -test('members index redirects if no workspace', function () { - $this->user->update(['current_workspace_id' => null]); - - $response = $this->actingAs($this->user)->get(route('app.members')); - - $response->assertRedirect(route('app.workspaces.create')); -}); - // Store invite tests test('store invite requires authentication', function () { $response = $this->post(route('app.invites.store'), [ diff --git a/tests/Feature/WorkspaceLabelControllerTest.php b/tests/Feature/WorkspaceLabelControllerTest.php index 3783d2c4..8021383a 100644 --- a/tests/Feature/WorkspaceLabelControllerTest.php +++ b/tests/Feature/WorkspaceLabelControllerTest.php @@ -1,5 +1,7 @@ toBeTrue(); }); diff --git a/tests/Unit/HelpersTest.php b/tests/Unit/HelpersTest.php index 1c7dc27b..0976480c 100644 --- a/tests/Unit/HelpersTest.php +++ b/tests/Unit/HelpersTest.php @@ -1,5 +1,7 @@ create(); - $user = User::factory()->create(['language_id' => $language->id]); - - expect($language->users)->toHaveCount(1); - expect($language->users->first()->id)->toBe($user->id); -}); - -test('language has fillable attributes', function () { - $language = Language::factory()->create([ - 'name' => 'Portuguese', - 'code' => 'pt-br', - ]); - - expect($language->name)->toBe('Portuguese'); - expect($language->code)->toBe('pt-br'); -}); diff --git a/tests/Unit/Models/MediaTest.php b/tests/Unit/Models/MediaTest.php index e33f834a..1b154bc3 100644 --- a/tests/Unit/Models/MediaTest.php +++ b/tests/Unit/Models/MediaTest.php @@ -1,5 +1,7 @@ create(['name' => 'Test User']); - $avatar = $user->avatar; - - expect($avatar['url'])->toContain('dicebear'); - expect($avatar['media_id'])->toBeNull(); + expect($user->has_photo)->toBeFalse(); + expect($user->photo_url)->toBeNull(); }); -test('user avatar attribute returns media url when exists', function () { +test('user has_photo returns true when avatar exists', function () { $user = User::factory()->create(['name' => 'Test User']); $file = UploadedFile::fake()->image('avatar.jpg', 100, 100); - $media = $user->addMedia($file, 'avatar'); + $user->addMedia($file, 'avatar'); $user->refresh(); - $avatar = $user->avatar; - expect($avatar['media_id'])->toBe($media->id); + expect($user->has_photo)->toBeTrue(); + expect($user->photo_url)->not->toBeNull(); }); diff --git a/tests/Unit/Traits/HasWorkspaceTest.php b/tests/Unit/Traits/HasWorkspaceTest.php index 7db4c01c..8e593928 100644 --- a/tests/Unit/Traits/HasWorkspaceTest.php +++ b/tests/Unit/Traits/HasWorkspaceTest.php @@ -1,5 +1,7 @@ Date: Mon, 30 Mar 2026 11:53:42 -0300 Subject: [PATCH 12/91] refactor: auth split layout, subscribe redesign, onboarding, i18n, cookie locale Auth pages: - Create AuthSplitLayout with animated feature slides (6 slides, 3 languages) - All auth pages use split layout (form left, visual right) - Add show/hide password toggle with tooltip on Register - Legal footer only shown on Register via showLegal prop Subscribe page: - Redesign to match auth card pattern (centered, clean) - Platform icons, feature checklist, dynamic trial days (trialDays - 1) - Add "Switch workspace" link - Full i18n (en, es, pt-BR) Onboarding: - Rename URLs: step1 -> role, step2 -> connect - Add enforceStep() to prevent skipping/going back steps - Redirect /onboarding to /onboarding/role - Redesign Step2 with AuthSplitLayout and compact platform list - 21 tests covering all step enforcement scenarios Workspaces page: - Redesign with AuthSplitLayout (list with avatars, current badge) Language system: - Move locale from DB to cookie (forever, unencrypted, session.domain) - Create SetLocale middleware (sets cookie if missing, validates against config) - Rename lang/pt-br to lang/pt-BR - Add dayjs es locale Other: - Copy utils.ts from sendkit (formatNumber, formatMoney, copyToClipboard) - ConfirmDeleteModal with text confirmation (sendkit pattern) - i18n for ConfirmDeleteModal internal strings (common.php) - EmptyState component for posts index - Exact match for "All" posts in sidebar - Posts breadcrumbs show current status filter - DialogFooter buttons aligned left - API Keys page redesign with Table, DropdownMenu, EmptyState - Extract CreateApiKeyDialog and InviteMemberDialog to components - Remove API Keys from sidebar - DropdownMenuItem destructive variant for Remove action --- CLAUDE.md | 7 +- README.md | 42 +-- app/Helpers/Asset.php | 13 + .../Controllers/App/OnboardingController.php | 37 +- .../App/Settings/ProfileController.php | 8 +- .../Controllers/App/WorkspaceController.php | 1 + .../App/WorkspaceInviteController.php | 29 ++ .../Auth/RegisteredUserController.php | 3 +- .../Controllers/Auth/SocialController.php | 2 +- .../App/EnsureUserSetupIsComplete.php | 16 +- .../Middleware/App/HandleInertiaRequests.php | 5 - app/Http/Middleware/App/SetLocale.php | 35 ++ .../AuthUserResource.php | 1 - app/Mail/WorkspaceConnectionsDisconnected.php | 2 +- app/Models/User.php | 9 - bootstrap/app.php | 4 +- composer.json | 3 +- config/app.php | 2 + config/languages.php | 2 +- database/factories/UserFactory.php | 1 - ...26_03_30_115716_drop_locale_from_users.php | 24 ++ lang/en/auth.php | 31 ++ lang/en/billing.php | 17 + lang/en/common.php | 12 + lang/en/settings.php | 3 + lang/es/auth.php | 31 ++ lang/es/billing.php | 17 + lang/es/common.php | 12 + lang/es/settings.php | 3 + lang/php_en.json | 1 + lang/php_es.json | 1 + lang/php_pt-BR.json | 1 + lang/pt-br/auth.php | 31 ++ lang/pt-br/billing.php | 17 + lang/pt-br/common.php | 12 + lang/pt-br/settings.php | 3 + maizzle/components/header.html | 2 +- resources/js/components/AppSidebar.vue | 53 +-- .../js/components/ConfirmDeleteModal.vue | 280 ++++++++++------ resources/js/components/EmptyState.vue | 19 ++ resources/js/components/NavMain.vue | 2 +- resources/js/components/UserMenuContent.vue | 2 +- .../api-keys/CreateApiKeyDialog.vue | 76 +++++ .../components/members/InviteMemberDialog.vue | 93 ++++++ .../js/components/ui/dialog/DialogFooter.vue | 2 +- resources/js/composables/useActiveUrl.ts | 6 +- resources/js/dayjs.ts | 13 +- resources/js/layouts/AuthLayout.vue | 11 +- resources/js/layouts/auth/AuthSplitLayout.vue | 226 +++++++++++++ resources/js/lib/utils.ts | 56 +++- resources/js/pages/auth/Register.vue | 50 ++- resources/js/pages/billing/Subscribe.vue | 153 +++++---- resources/js/pages/onboarding/Step2.vue | 133 ++++++-- resources/js/pages/posts/Edit.vue | 1 - resources/js/pages/posts/Index.vue | 43 +-- resources/js/pages/settings/ApiKeys.vue | 316 +++++++----------- resources/js/pages/settings/Workspace.vue | 112 ++----- resources/js/pages/workspaces/Index.vue | 120 +++---- resources/js/types/index.d.ts | 3 +- .../views/mail/account-disconnected.blade.php | 2 +- .../views/mail/email-verification.blade.php | 2 +- resources/views/mail/password-reset.blade.php | 2 +- ...rkspace-connections-disconnected.blade.php | 2 +- .../views/mail/workspace-invite.blade.php | 2 +- routes/app.php | 10 +- tests/Feature/Auth/RegistrationTest.php | 2 +- .../EnsureUserSetupIsCompleteTest.php | 10 +- tests/Feature/OnboardingControllerTest.php | 89 ++++- tests/Feature/Settings/ProfileUpdateTest.php | 4 +- .../Feature/WorkspaceInviteControllerTest.php | 70 ++++ 70 files changed, 1659 insertions(+), 746 deletions(-) create mode 100644 app/Helpers/Asset.php create mode 100644 app/Http/Middleware/App/SetLocale.php create mode 100644 database/migrations/2026_03_30_115716_drop_locale_from_users.php create mode 100644 lang/en/common.php create mode 100644 lang/es/common.php create mode 100644 lang/php_en.json create mode 100644 lang/php_es.json create mode 100644 lang/php_pt-BR.json create mode 100644 lang/pt-br/common.php create mode 100644 resources/js/components/EmptyState.vue create mode 100644 resources/js/components/api-keys/CreateApiKeyDialog.vue create mode 100644 resources/js/components/members/InviteMemberDialog.vue create mode 100644 resources/js/layouts/auth/AuthSplitLayout.vue diff --git a/CLAUDE.md b/CLAUDE.md index 50ebbb7e..a615c21c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -44,7 +44,7 @@ ## Skills Activation - `cashier-stripe-development` — Handles Laravel Cashier Stripe integration including subscriptions, webhooks, Stripe Checkout, invoices, charges, refunds, trials, coupons, metered billing, and payment failure handling. Triggered when a user mentions Cashier, Billable, IncompletePayment, stripe_id, newSubscription, Stripe subscriptions, or billing. Also applies when setting up webhooks, handling SCA/3DS payment failures, testing with Stripe test cards, or troubleshooting incomplete subscriptions, CSRF webhook errors, or migration publish issues. - `laravel-best-practices` — Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns. - `configuring-horizon` — Use this skill whenever the user mentions Horizon by name in a Laravel context. Covers the full Horizon lifecycle: installing Horizon (horizon:install, Sail setup), configuring config/horizon.php (supervisor blocks, queue assignments, balancing strategies, minProcesses/maxProcesses), fixing the dashboard (authorization via Gate::define viewHorizon, blank metrics, horizon:snapshot scheduling), and troubleshooting production issues (worker crashes, timeout chain ordering, LongWaitDetected notifications, waits config). Also covers job tagging and silencing. Do not use for generic Laravel queues without Horizon, SQS or database drivers, standalone Redis setup, Linux supervisord, Telescope, or job batching. -- `mcp-development` — Use this skill for Laravel MCP development only. Trigger when creating or editing MCP tools, resources, prompts, or servers in Laravel projects. Covers: artisan make:mcp-* generators, mcp:inspector, routes/ai.php, Tool/Resource/Prompt classes, schema validation, shouldRegister(), OAuth setup, URI templates, read-only attributes, and MCP debugging. Do not use for non-Laravel MCP projects or generic AI features without MCP. +- `mcp-development` — Use this skill for Laravel MCP development only. Trigger when creating or editing MCP tools, resources, prompts, or servers in Laravel projects. Covers: artisan make:mcp-\* generators, mcp:inspector, routes/ai.php, Tool/Resource/Prompt classes, schema validation, shouldRegister(), OAuth setup, URI templates, read-only attributes, and MCP debugging. Do not use for non-Laravel MCP projects or generic AI features without MCP. - `socialite-development` — Manages OAuth social authentication with Laravel Socialite. Activate when adding social login providers; configuring OAuth redirect/callback flows; retrieving authenticated user details; customizing scopes or parameters; setting up community providers; testing with Socialite fakes; or when the user mentions social login, OAuth, Socialite, or third-party authentication. - `wayfinder-development` — Use this skill for Laravel Wayfinder which auto-generates typed functions for Laravel controllers and routes. ALWAYS use this skill when frontend code needs to call backend routes or controller actions. Trigger when: connecting any React/Vue/Svelte/Inertia frontend to Laravel controllers, routes, building end-to-end features with both frontend and backend, wiring up forms or links to backend endpoints, fixing route-related TypeScript errors, importing from @/actions or @/routes, or running wayfinder:generate. Use Wayfinder route functions instead of hardcoded URLs. Covers: wayfinder() vite plugin, .url()/.get()/.post()/.form(), query params, route model binding, tree-shaking. Do not use for backend-only task - `pest-testing` — Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to write something in Pest, mentions test files or directories (tests/Feature, tests/Unit, tests/Browser), or needs browser testing, smoke testing multiple pages for JS errors, or architecture tests. Covers: it()/expect() syntax, datasets, mocking, browser testing (visit/click/fill), smoke testing, arch(), Livewire component tests, RefreshDatabase, and all Pest 4 features. Do not use for factories, seeders, migrations, controllers, models, or non-test PHP code. @@ -115,7 +115,7 @@ ## Tinker - Execute PHP in app context for debugging and testing code. Do not create models without user approval, prefer tests with factories instead. Prefer existing Artisan commands over custom tinker code. - Always use single quotes to prevent shell expansion: `vendor/bin/sail artisan tinker --execute 'Your::code();'` - - Double quotes for PHP strings inside: `vendor/bin/sail artisan tinker --execute 'User::where("active", true)->count();'` + - Double quotes for PHP strings inside: `vendor/bin/sail artisan tinker --execute 'User::where("active", true)->count();'` === php rules === @@ -228,6 +228,7 @@ ## Pest # Inertia + Vue Vue components must have a single root element. + - IMPORTANT: Activate `inertia-vue-development` when working with Inertia Vue client-side patterns. @@ -244,6 +245,8 @@ ## Icons (@tabler/icons-vue) - All Tabler icons are prefixed with `Icon`, e.g. `IconCheck`, `IconChevronRight`, `IconMail`. - Import icons from `@tabler/icons-vue`: `import { IconCheck, IconX } from '@tabler/icons-vue'`. - Browse available icons at https://tabler.io/icons +- Button never use icon + text, it's icon or text, never together +- dropdown lists always use icon + text, and both have the same color ## Dates diff --git a/README.md b/README.md index b1519da5..f7a41a8d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@

- 📚 Documentation • + 📚 Documentation • 🗺️ Roadmap • 💬 Community

@@ -30,23 +30,23 @@ ## 🤔 Why TryPost? Tired of paying expensive monthly fees for social media scheduling tools? Want full control over your data? TryPost is the solution. -| | | -|---|---| -| 🔓 **100% Open Source** | Inspect the code, contribute, make it yours | -| 🏠 **Self-Hosted** | Your data stays on your servers | -| ♾️ **No Limits** | Schedule unlimited posts, connect unlimited accounts | -| 🔒 **Privacy First** | No tracking, no analytics, no data selling | +| | | +| ----------------------- | ---------------------------------------------------- | +| 🔓 **100% Open Source** | Inspect the code, contribute, make it yours | +| 🏠 **Self-Hosted** | Your data stays on your servers | +| ♾️ **No Limits** | Schedule unlimited posts, connect unlimited accounts | +| 🔒 **Privacy First** | No tracking, no analytics, no data selling | ## ✨ Features -| | | -|---|---| -| 📅 **Visual Calendar** | Drag and drop posts across your content calendar | -| ✍️ **Post Composer** | Create and preview posts for multiple platforms at once | -| 🖼️ **Media Library** | Upload images and videos with automatic optimization | -| 👥 **Team Collaboration** | Invite team members with role-based permissions | -| 🏢 **Workspaces** | Manage multiple brands or clients separately | -| 👀 **Multi-Platform Preview** | See exactly how your post will look on each platform | +| | | +| ----------------------------- | ------------------------------------------------------- | +| 📅 **Visual Calendar** | Drag and drop posts across your content calendar | +| ✍️ **Post Composer** | Create and preview posts for multiple platforms at once | +| 🖼️ **Media Library** | Upload images and videos with automatic optimization | +| 👥 **Team Collaboration** | Invite team members with role-based permissions | +| 🏢 **Workspaces** | Manage multiple brands or clients separately | +| 👀 **Multi-Platform Preview** | See exactly how your post will look on each platform | ## 🌐 Supported Platforms @@ -71,12 +71,12 @@ ## 🚀 Getting Started Get TryPost running in minutes: -| | | -|---|---| -| 📖 [Installation Guide](https://docs.trypost.it/getting-started/installation) | Step-by-step setup | -| 🐳 [Docker Setup](https://docs.trypost.it/self-hosting/docker) | Run with Laravel Sail | -| ⚙️ [Configuration](https://docs.trypost.it/getting-started/configuration) | Environment setup | -| 🔗 [Platform Setup](https://docs.trypost.it/platforms/) | Connect your social accounts | +| | | +| ----------------------------------------------------------------------------- | ---------------------------- | +| 📖 [Installation Guide](https://trypost.it/docs/getting-started/installation) | Step-by-step setup | +| 🐳 [Docker Setup](https://trypost.it/docs/self-hosting/docker) | Run with Laravel Sail | +| ⚙️ [Configuration](https://trypost.it/docs/getting-started/configuration) | Environment setup | +| 🔗 [Platform Setup](https://trypost.it/docs/platforms/) | Connect your social accounts | ## 🤝 Contributing diff --git a/app/Helpers/Asset.php b/app/Helpers/Asset.php new file mode 100644 index 00000000..12bafc08 --- /dev/null +++ b/app/Helpers/Asset.php @@ -0,0 +1,13 @@ +enforceStep($request->user(), Setup::Role); + if ($redirect) { + return $redirect; + } + return Inertia::render('onboarding/Step1', [ 'personas' => Persona::toSelectArray(), ]); @@ -34,11 +40,16 @@ public function storeStep1(Request $request): RedirectResponse 'setup' => Setup::Connections, ]); - return redirect()->route('app.onboarding.step2'); + return redirect()->route('app.onboarding.connect'); } - public function step2(Request $request): Response + public function step2(Request $request): Response|RedirectResponse { + $redirect = $this->enforceStep($request->user(), Setup::Connections); + if ($redirect) { + return $redirect; + } + $user = $request->user(); $workspace = $user->currentWorkspace; @@ -88,7 +99,7 @@ public function storeStep2(Request $request): SymfonyResponse|RedirectResponse $checkoutSession = $subscription->checkout([ 'success_url' => route('app.onboarding.complete').'?session_id={CHECKOUT_SESSION_ID}', - 'cancel_url' => route('app.onboarding.step2'), + 'cancel_url' => route('app.onboarding.connect'), ]); return Inertia::location($checkoutSession->url); @@ -107,4 +118,22 @@ public function complete(Request $request): RedirectResponse return redirect()->route('app.calendar'); } + + private function enforceStep(User $user, Setup $expectedStep): ?RedirectResponse + { + if ($user->setup === $expectedStep) { + return null; + } + + if ($user->setup === Setup::Completed) { + return redirect()->route('app.calendar'); + } + + return match ($user->setup) { + Setup::Role => redirect()->route('app.onboarding.role'), + Setup::Connections => redirect()->route('app.onboarding.connect'), + Setup::Subscription => redirect()->route('app.subscribe'), + default => redirect()->route('app.onboarding.role'), + }; + } } diff --git a/app/Http/Controllers/App/Settings/ProfileController.php b/app/Http/Controllers/App/Settings/ProfileController.php index 30ad8594..ef0cd314 100644 --- a/app/Http/Controllers/App/Settings/ProfileController.php +++ b/app/Http/Controllers/App/Settings/ProfileController.php @@ -77,14 +77,12 @@ public function updateLanguage(Request $request): RedirectResponse 'locale' => ['required', 'string', 'in:'.implode(',', array_keys(config('languages.available')))], ]); - $request->user()->update([ - 'locale' => $request->locale, - ]); - session()->flash('flash.banner', __('settings.flash.language_updated')); session()->flash('flash.bannerStyle', 'success'); - return back(); + return back()->withCookie( + cookie()->forever('locale', $request->locale, '/', config('session.domain')) + ); } public function destroy(ProfileDeleteRequest $request): RedirectResponse diff --git a/app/Http/Controllers/App/WorkspaceController.php b/app/Http/Controllers/App/WorkspaceController.php index 72f645e7..0e3cebf8 100644 --- a/app/Http/Controllers/App/WorkspaceController.php +++ b/app/Http/Controllers/App/WorkspaceController.php @@ -21,6 +21,7 @@ public function index(Request $request): Response $user = $request->user(); $workspaces = $user->workspaces() + ->with('media') ->withCount(['socialAccounts', 'posts']) ->latest() ->get(); diff --git a/app/Http/Controllers/App/WorkspaceInviteController.php b/app/Http/Controllers/App/WorkspaceInviteController.php index 39068f01..969ccf67 100644 --- a/app/Http/Controllers/App/WorkspaceInviteController.php +++ b/app/Http/Controllers/App/WorkspaceInviteController.php @@ -12,6 +12,7 @@ use App\Models\WorkspaceInvite; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; +use Illuminate\Validation\Rule; use Inertia\Inertia; use Inertia\Response; @@ -133,4 +134,32 @@ public function removeMember(Request $request, string $userId): RedirectResponse return back(); } + + public function updateRole(Request $request, string $userId): RedirectResponse + { + $workspace = $request->user()->currentWorkspace; + + if (! $workspace) { + return redirect()->route('app.workspaces.create'); + } + + $this->authorize('manageTeam', $workspace); + + if ($workspace->user_id === $userId) { + return back()->withErrors(['role' => 'Cannot change the workspace owner role.']); + } + + $validated = $request->validate([ + 'role' => ['required', Rule::enum(WorkspaceRole::class)], + ]); + + $workspace->members()->updateExistingPivot($userId, [ + 'role' => data_get($validated, 'role'), + ]); + + session()->flash('flash.banner', __('settings.members.flash.role_updated')); + session()->flash('flash.bannerStyle', 'success'); + + return back(); + } } diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 9edaccb4..83a6d034 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -52,7 +52,6 @@ public function store(Request $request): RedirectResponse 'email' => $request->email, 'password' => $request->password, 'setup' => $isInviteRegistration ? Setup::Completed : Setup::Role, - 'locale' => config('languages.default'), 'email_verified_at' => $isInviteRegistration ? now() : null, ]); @@ -81,6 +80,6 @@ public function store(Request $request): RedirectResponse return redirect($redirect); } - return redirect()->route('app.onboarding.step1'); + return redirect()->route('app.onboarding.role'); } } diff --git a/app/Http/Controllers/Auth/SocialController.php b/app/Http/Controllers/Auth/SocialController.php index 5ed0e076..88005eeb 100644 --- a/app/Http/Controllers/Auth/SocialController.php +++ b/app/Http/Controllers/Auth/SocialController.php @@ -179,7 +179,7 @@ protected function forgetSocialConnectSession(): void protected function getRedirectRoute(): string { - return session('social_connect_onboarding', false) ? 'onboarding.step2' : 'accounts'; + return session('social_connect_onboarding', false) ? 'onboarding.connect' : 'accounts'; } /** diff --git a/app/Http/Middleware/App/EnsureUserSetupIsComplete.php b/app/Http/Middleware/App/EnsureUserSetupIsComplete.php index 37c279a2..caffd2b7 100644 --- a/app/Http/Middleware/App/EnsureUserSetupIsComplete.php +++ b/app/Http/Middleware/App/EnsureUserSetupIsComplete.php @@ -31,10 +31,10 @@ public function handle(Request $request, Closure $next): Response // Map setup status to allowed routes $allowedRoutes = match ($user->setup) { - Setup::Role => ['onboarding.step1', 'onboarding.step1.store'], - Setup::Connections => ['onboarding.step2', 'onboarding.step2.store', 'social.*'], - Setup::Subscription => ['onboarding.complete', 'onboarding.step2'], - default => ['onboarding.step1', 'onboarding.step1.store'], + Setup::Role => ['onboarding.role', 'onboarding.role.store'], + Setup::Connections => ['onboarding.connect', 'onboarding.connect.store', 'social.*'], + Setup::Subscription => ['onboarding.complete', 'onboarding.connect'], + default => ['onboarding.role', 'onboarding.role.store'], }; $currentRoute = $request->route()?->getName(); @@ -48,10 +48,10 @@ public function handle(Request $request, Closure $next): Response // Redirect to appropriate step return match ($user->setup) { - Setup::Role => redirect()->route('app.onboarding.step1'), - Setup::Connections => redirect()->route('app.onboarding.step2'), - Setup::Subscription => redirect()->route('app.onboarding.step2'), - default => redirect()->route('app.onboarding.step1'), + Setup::Role => redirect()->route('app.onboarding.role'), + Setup::Connections => redirect()->route('app.onboarding.connect'), + Setup::Subscription => redirect()->route('app.onboarding.connect'), + default => redirect()->route('app.onboarding.role'), }; } } diff --git a/app/Http/Middleware/App/HandleInertiaRequests.php b/app/Http/Middleware/App/HandleInertiaRequests.php index 29d1097e..dab26efc 100644 --- a/app/Http/Middleware/App/HandleInertiaRequests.php +++ b/app/Http/Middleware/App/HandleInertiaRequests.php @@ -7,7 +7,6 @@ use App\Http\Resources\App\HandleInertiaRequests\AuthUserResource; use App\Http\Resources\App\HandleInertiaRequests\AuthWorkspaceResource; use Illuminate\Http\Request; -use Illuminate\Support\Facades\App; use Inertia\Middleware; class HandleInertiaRequests extends Middleware @@ -26,10 +25,6 @@ public function share(Request $request): array { $user = $request->user(); - if ($user?->locale) { - App::setLocale($user->locale); - } - $currentWorkspace = $user?->currentWorkspace?->load('media'); return [ diff --git a/app/Http/Middleware/App/SetLocale.php b/app/Http/Middleware/App/SetLocale.php new file mode 100644 index 00000000..fecf0fe0 --- /dev/null +++ b/app/Http/Middleware/App/SetLocale.php @@ -0,0 +1,35 @@ +cookie('locale'); + $isValid = $locale && array_key_exists($locale, $available); + + App::setLocale($isValid ? $locale : config('languages.default')); + + $response = $next($request); + + if (! $isValid) { + $response->withCookie( + cookie()->forever('locale', config('languages.default'), '/', config('session.domain')), + ); + } + + return $response; + } +} diff --git a/app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php b/app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php index a75ecf22..ca20b7d9 100644 --- a/app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php +++ b/app/Http/Resources/App/HandleInertiaRequests/AuthUserResource.php @@ -21,7 +21,6 @@ public static function make(User $user): array 'photo_url' => $user->photo_url, 'email_verified_at' => $user->email_verified_at?->toIso8601String(), 'current_workspace_id' => $user->current_workspace_id, - 'locale' => $user->locale, 'created_at' => $user->created_at->toIso8601String(), 'updated_at' => $user->updated_at->toIso8601String(), ]; diff --git a/app/Mail/WorkspaceConnectionsDisconnected.php b/app/Mail/WorkspaceConnectionsDisconnected.php index 65808cdb..ebc88985 100644 --- a/app/Mail/WorkspaceConnectionsDisconnected.php +++ b/app/Mail/WorkspaceConnectionsDisconnected.php @@ -25,7 +25,7 @@ public function __construct( public Workspace $workspace, public Collection $disconnectedAccounts ) { - $this->locale = $this->workspace->owner?->locale ?? 'en'; + $this->locale = config('app.locale'); } public function envelope(): Envelope diff --git a/app/Models/User.php b/app/Models/User.php index 7eaa0a74..60d27ce7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -33,7 +33,6 @@ class User extends Authenticatable implements MustVerifyEmail 'setup', 'persona', 'current_workspace_id', - 'locale', 'email_verified_at', ]; @@ -80,14 +79,6 @@ protected function casts(): array ]; } - /** - * Get the user's locale code (e.g. 'en', 'es', 'pt-br'). - */ - public function getLocaleCode(): string - { - return $this->locale ?? 'en'; - } - /** * Check if user has an active subscription. * In self-hosted mode, always returns true (no subscription required). diff --git a/bootstrap/app.php b/bootstrap/app.php index e8b623e8..62d1c155 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -4,6 +4,7 @@ use App\Http\Middleware\App\EnsureSubscribed; use App\Http\Middleware\App\HandleAppearance; use App\Http\Middleware\App\HandleInertiaRequests; +use App\Http\Middleware\App\SetLocale; use App\Http\Middleware\Mcp\AuthenticateMcpToken; use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; @@ -25,9 +26,10 @@ ->withMiddleware(function (Middleware $middleware): void { $middleware->trustProxies(at: '*'); - $middleware->encryptCookies(except: ['appearance', 'sidebar_state']); + $middleware->encryptCookies(except: ['appearance', 'sidebar_state', 'locale']); $middleware->web(append: [ + SetLocale::class, HandleAppearance::class, HandleInertiaRequests::class, AddLinkHeadersForPreloadedAssets::class, diff --git a/composer.json b/composer.json index 42398170..2ad891be 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,8 @@ }, "autoload": { "files": [ - "app/Helpers/upload.php" + "app/Helpers/Upload.php", + "app/Helpers/Asset.php" ], "psr-4": { "App\\": "app/", diff --git a/config/app.php b/config/app.php index 7d48fac7..a28266cd 100644 --- a/config/app.php +++ b/config/app.php @@ -56,6 +56,8 @@ 'url' => env('APP_URL', 'http://localhost'), + 'email_asset_url' => env('EMAIL_ASSET_URL', 'https://app.trypost.it'), + /* |-------------------------------------------------------------------------- | Application Timezone diff --git a/config/languages.php b/config/languages.php index e3c9168f..16fb788a 100644 --- a/config/languages.php +++ b/config/languages.php @@ -18,7 +18,7 @@ 'available' => [ 'en' => 'English', 'es' => 'Español', - 'pt-br' => 'Português', + 'pt-BR' => 'Português', ], /* diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 3f35050a..7c5fff22 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -33,7 +33,6 @@ public function definition(): array 'password' => static::$password ??= Hash::make('password'), 'remember_token' => Str::random(10), 'current_workspace_id' => null, - 'locale' => 'en', 'stripe_id' => null, 'pm_type' => null, 'pm_last_four' => null, diff --git a/database/migrations/2026_03_30_115716_drop_locale_from_users.php b/database/migrations/2026_03_30_115716_drop_locale_from_users.php new file mode 100644 index 00000000..29542842 --- /dev/null +++ b/database/migrations/2026_03_30_115716_drop_locale_from_users.php @@ -0,0 +1,24 @@ +dropColumn('locale'); + }); + } + + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->string('locale', 10)->default('en')->after('current_workspace_id'); + }); + } +}; diff --git a/lang/en/auth.php b/lang/en/auth.php index be4ac939..e2af5863 100644 --- a/lang/en/auth.php +++ b/lang/en/auth.php @@ -22,6 +22,35 @@ 'welcome_trial' => 'Welcome to TryPost! Your trial has started.', ], + 'legal' => 'By continuing, you agree to our Terms of Service and Privacy Policy.', + + 'slides' => [ + 'calendar' => [ + 'title' => 'Visual Calendar', + 'description' => 'Plan and schedule your content with an intuitive drag-and-drop calendar across all your social accounts.', + ], + 'scheduling' => [ + 'title' => 'Smart Scheduling', + 'description' => 'Schedule posts across LinkedIn, X, Instagram, TikTok, YouTube, and more — all from one place.', + ], + 'media' => [ + 'title' => 'Rich Media', + 'description' => 'Publish images, carousels, stories, and reels. Each platform gets the right format automatically.', + ], + 'video' => [ + 'title' => 'Video Publishing', + 'description' => 'Upload videos once and publish to TikTok, YouTube Shorts, Instagram Reels, and Facebook Reels.', + ], + 'team' => [ + 'title' => 'Team Workspaces', + 'description' => 'Invite your team, assign roles, and manage multiple brands from separate workspaces.', + ], + 'hashtags' => [ + 'title' => 'Hashtag Groups', + 'description' => 'Save hashtag collections and add them to posts with one click. Organize with labels and filters.', + ], + ], + 'login' => [ 'title' => 'Log in to your account', 'description' => 'Enter your email and password below to log in', @@ -43,6 +72,8 @@ 'name_placeholder' => 'Full name', 'email' => 'Email address', 'password' => 'Password', + 'show_password' => 'Show password', + 'hide_password' => 'Hide password', 'submit' => 'Create account', 'has_account' => 'Already have an account?', 'log_in' => 'Log in', diff --git a/lang/en/billing.php b/lang/en/billing.php index 33448842..30f02399 100644 --- a/lang/en/billing.php +++ b/lang/en/billing.php @@ -4,6 +4,23 @@ 'title' => 'Subscription', 'description' => 'Manage your subscription and payment method', + 'subscribe' => [ + 'page_title' => 'Start your free trial', + 'title' => 'Start your free trial', + 'description' => ':days days free. No credit card required to start.', + 'start_trial' => 'Start :days-day free trial', + 'cancel_anytime' => 'Cancel anytime. No questions asked.', + 'switch_workspace' => 'Switch workspace', + 'features' => [ + 'calendar' => 'Visual drag-and-drop calendar', + 'scheduling' => 'Unlimited post scheduling', + 'media' => 'Images, carousels & stories', + 'video' => 'Video publishing across platforms', + 'team' => 'Team collaboration & workspaces', + 'hashtags' => 'Hashtag groups & labels', + ], + ], + 'trial' => [ 'title' => 'Trial period active', 'description' => 'Your trial ends on :date. After that, your subscription will be charged automatically.', diff --git a/lang/en/common.php b/lang/en/common.php new file mode 100644 index 00000000..7044de87 --- /dev/null +++ b/lang/en/common.php @@ -0,0 +1,12 @@ + [ + 'cannot_be_undone' => 'This cannot be undone.', + 'type' => 'Type', + 'to_confirm' => 'to confirm.', + 'copy_to_clipboard' => 'Copy to clipboard', + ], +]; diff --git a/lang/en/settings.php b/lang/en/settings.php index 76973cee..f7876819 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -77,6 +77,8 @@ 'cancel' => 'Cancel', 'remove' => 'Remove', + 'make_admin' => 'Make admin', + 'make_member' => 'Make member', 'invite' => [ 'title' => 'Invite Member', @@ -122,6 +124,7 @@ 'invite_sent' => 'Invite sent successfully!', 'invite_deleted' => 'Invite deleted.', 'member_removed' => 'Member removed successfully.', + 'role_updated' => 'Member role updated.', 'wrong_email' => 'This invite is for a different email address.', 'already_member' => 'You are already a member of this workspace.', 'invite_accepted' => 'Welcome! You are now a member of the workspace.', diff --git a/lang/es/auth.php b/lang/es/auth.php index ba016ab9..011a6122 100644 --- a/lang/es/auth.php +++ b/lang/es/auth.php @@ -10,6 +10,35 @@ 'welcome_trial' => '¡Bienvenido a TryPost! Tu prueba ha comenzado.', ], + 'legal' => 'Al continuar, aceptas nuestros Términos de Servicio y Política de Privacidad.', + + 'slides' => [ + 'calendar' => [ + 'title' => 'Calendario Visual', + 'description' => 'Planifica y programa tu contenido con un calendario intuitivo de arrastrar y soltar en todas tus cuentas sociales.', + ], + 'scheduling' => [ + 'title' => 'Programación Inteligente', + 'description' => 'Programa posts en LinkedIn, X, Instagram, TikTok, YouTube y más — todo desde un solo lugar.', + ], + 'media' => [ + 'title' => 'Contenido Multimedia', + 'description' => 'Publica imágenes, carruseles, historias y reels. Cada plataforma recibe el formato correcto automáticamente.', + ], + 'video' => [ + 'title' => 'Publicación de Video', + 'description' => 'Sube videos una vez y publícalos en TikTok, YouTube Shorts, Instagram Reels y Facebook Reels.', + ], + 'team' => [ + 'title' => 'Workspaces en Equipo', + 'description' => 'Invita a tu equipo, asigna roles y gestiona múltiples marcas en workspaces separados.', + ], + 'hashtags' => [ + 'title' => 'Grupos de Hashtags', + 'description' => 'Guarda colecciones de hashtags y agrégalos a tus posts con un clic. Organiza con etiquetas y filtros.', + ], + ], + 'login' => [ 'title' => 'Inicia sesión en tu cuenta', 'description' => 'Introduce tu correo y contraseña para iniciar sesión', @@ -31,6 +60,8 @@ 'name_placeholder' => 'Nombre completo', 'email' => 'Correo electrónico', 'password' => 'Contraseña', + 'show_password' => 'Mostrar contraseña', + 'hide_password' => 'Ocultar contraseña', 'submit' => 'Crear cuenta', 'has_account' => '¿Ya tienes una cuenta?', 'log_in' => 'Iniciar sesión', diff --git a/lang/es/billing.php b/lang/es/billing.php index 0d54e732..fd620b0d 100644 --- a/lang/es/billing.php +++ b/lang/es/billing.php @@ -4,6 +4,23 @@ 'title' => 'Suscripción', 'description' => 'Administra tu suscripción y método de pago', + 'subscribe' => [ + 'page_title' => 'Comienza tu prueba gratuita', + 'title' => 'Comienza tu prueba gratuita', + 'description' => ':days días gratis. Sin tarjeta de crédito para empezar.', + 'start_trial' => 'Comenzar prueba de :days días', + 'cancel_anytime' => 'Cancela en cualquier momento. Sin preguntas.', + 'switch_workspace' => 'Cambiar workspace', + 'features' => [ + 'calendar' => 'Calendario visual con arrastrar y soltar', + 'scheduling' => 'Programación ilimitada de posts', + 'media' => 'Imágenes, carruseles e historias', + 'video' => 'Publicación de videos en todas las plataformas', + 'team' => 'Colaboración en equipo y workspaces', + 'hashtags' => 'Grupos de hashtags y etiquetas', + ], + ], + 'trial' => [ 'title' => 'Periodo de prueba activo', 'description' => 'Tu prueba termina el :date. Después, tu suscripción se cobrará automáticamente.', diff --git a/lang/es/common.php b/lang/es/common.php new file mode 100644 index 00000000..1b36b723 --- /dev/null +++ b/lang/es/common.php @@ -0,0 +1,12 @@ + [ + 'cannot_be_undone' => 'Esta acción no se puede deshacer.', + 'type' => 'Escribe', + 'to_confirm' => 'para confirmar.', + 'copy_to_clipboard' => 'Copiar al portapapeles', + ], +]; diff --git a/lang/es/settings.php b/lang/es/settings.php index 24eb7a73..b5e3cef0 100644 --- a/lang/es/settings.php +++ b/lang/es/settings.php @@ -77,6 +77,8 @@ 'cancel' => 'Cancelar', 'remove' => 'Eliminar', + 'make_admin' => 'Hacer administrador', + 'make_member' => 'Hacer miembro', 'invite' => [ 'title' => 'Invitar miembro', @@ -122,6 +124,7 @@ 'invite_sent' => '¡Invitación enviada correctamente!', 'invite_deleted' => 'Invitación eliminada.', 'member_removed' => '¡Miembro eliminado correctamente!', + 'role_updated' => 'Rol del miembro actualizado.', 'wrong_email' => 'Esta invitación es para otro correo electrónico.', 'already_member' => 'Ya eres miembro de este workspace.', 'invite_accepted' => '¡Bienvenido! Ahora eres miembro del workspace.', diff --git a/lang/php_en.json b/lang/php_en.json new file mode 100644 index 00000000..b1dba844 --- /dev/null +++ b/lang/php_en.json @@ -0,0 +1 @@ +{"auth.failed":"These credentials do not match our records.","auth.password":"The provided password is incorrect.","auth.throttle":"Too many login attempts. Please try again in :seconds seconds.","pagination.previous":"« Previous","pagination.next":"Next »","passwords.reset":"Your password has been reset.","passwords.sent":"We have emailed your password reset link.","passwords.throttled":"Please wait before retrying.","passwords.token":"This password reset token is invalid.","passwords.user":"We can't find a user with that email address.","validation.accepted":"The :attribute field must be accepted.","validation.accepted_if":"The :attribute field must be accepted when :other is :value.","validation.active_url":"The :attribute field must be a valid URL.","validation.after":"The :attribute field must be a date after :date.","validation.after_or_equal":"The :attribute field must be a date after or equal to :date.","validation.alpha":"The :attribute field must only contain letters.","validation.alpha_dash":"The :attribute field must only contain letters, numbers, dashes, and underscores.","validation.alpha_num":"The :attribute field must only contain letters and numbers.","validation.any_of":"The :attribute field is invalid.","validation.array":"The :attribute field must be an array.","validation.ascii":"The :attribute field must only contain single-byte alphanumeric characters and symbols.","validation.before":"The :attribute field must be a date before :date.","validation.before_or_equal":"The :attribute field must be a date before or equal to :date.","validation.between.array":"The :attribute field must have between :min and :max items.","validation.between.file":"The :attribute field must be between :min and :max kilobytes.","validation.between.numeric":"The :attribute field must be between :min and :max.","validation.between.string":"The :attribute field must be between :min and :max characters.","validation.boolean":"The :attribute field must be true or false.","validation.can":"The :attribute field contains an unauthorized value.","validation.confirmed":"The :attribute field confirmation does not match.","validation.contains":"The :attribute field is missing a required value.","validation.current_password":"The password is incorrect.","validation.date":"The :attribute field must be a valid date.","validation.date_equals":"The :attribute field must be a date equal to :date.","validation.date_format":"The :attribute field must match the format :format.","validation.decimal":"The :attribute field must have :decimal decimal places.","validation.declined":"The :attribute field must be declined.","validation.declined_if":"The :attribute field must be declined when :other is :value.","validation.different":"The :attribute field and :other must be different.","validation.digits":"The :attribute field must be :digits digits.","validation.digits_between":"The :attribute field must be between :min and :max digits.","validation.dimensions":"The :attribute field has invalid image dimensions.","validation.distinct":"The :attribute field has a duplicate value.","validation.doesnt_contain":"The :attribute field must not contain any of the following: :values.","validation.doesnt_end_with":"The :attribute field must not end with one of the following: :values.","validation.doesnt_start_with":"The :attribute field must not start with one of the following: :values.","validation.email":"The :attribute field must be a valid email address.","validation.encoding":"The :attribute field must be encoded in :encoding.","validation.ends_with":"The :attribute field must end with one of the following: :values.","validation.enum":"The selected :attribute is invalid.","validation.exists":"The selected :attribute is invalid.","validation.extensions":"The :attribute field must have one of the following extensions: :values.","validation.file":"The :attribute field must be a file.","validation.filled":"The :attribute field must have a value.","validation.gt.array":"The :attribute field must have more than :value items.","validation.gt.file":"The :attribute field must be greater than :value kilobytes.","validation.gt.numeric":"The :attribute field must be greater than :value.","validation.gt.string":"The :attribute field must be greater than :value characters.","validation.gte.array":"The :attribute field must have :value items or more.","validation.gte.file":"The :attribute field must be greater than or equal to :value kilobytes.","validation.gte.numeric":"The :attribute field must be greater than or equal to :value.","validation.gte.string":"The :attribute field must be greater than or equal to :value characters.","validation.hex_color":"The :attribute field must be a valid hexadecimal color.","validation.image":"The :attribute field must be an image.","validation.in":"The selected :attribute is invalid.","validation.in_array":"The :attribute field must exist in :other.","validation.in_array_keys":"The :attribute field must contain at least one of the following keys: :values.","validation.integer":"The :attribute field must be an integer.","validation.ip":"The :attribute field must be a valid IP address.","validation.ipv4":"The :attribute field must be a valid IPv4 address.","validation.ipv6":"The :attribute field must be a valid IPv6 address.","validation.json":"The :attribute field must be a valid JSON string.","validation.list":"The :attribute field must be a list.","validation.lowercase":"The :attribute field must be lowercase.","validation.lt.array":"The :attribute field must have less than :value items.","validation.lt.file":"The :attribute field must be less than :value kilobytes.","validation.lt.numeric":"The :attribute field must be less than :value.","validation.lt.string":"The :attribute field must be less than :value characters.","validation.lte.array":"The :attribute field must not have more than :value items.","validation.lte.file":"The :attribute field must be less than or equal to :value kilobytes.","validation.lte.numeric":"The :attribute field must be less than or equal to :value.","validation.lte.string":"The :attribute field must be less than or equal to :value characters.","validation.mac_address":"The :attribute field must be a valid MAC address.","validation.max.array":"The :attribute field must not have more than :max items.","validation.max.file":"The :attribute field must not be greater than :max kilobytes.","validation.max.numeric":"The :attribute field must not be greater than :max.","validation.max.string":"The :attribute field must not be greater than :max characters.","validation.max_digits":"The :attribute field must not have more than :max digits.","validation.mimes":"The :attribute field must be a file of type: :values.","validation.mimetypes":"The :attribute field must be a file of type: :values.","validation.min.array":"The :attribute field must have at least :min items.","validation.min.file":"The :attribute field must be at least :min kilobytes.","validation.min.numeric":"The :attribute field must be at least :min.","validation.min.string":"The :attribute field must be at least :min characters.","validation.min_digits":"The :attribute field must have at least :min digits.","validation.missing":"The :attribute field must be missing.","validation.missing_if":"The :attribute field must be missing when :other is :value.","validation.missing_unless":"The :attribute field must be missing unless :other is :value.","validation.missing_with":"The :attribute field must be missing when :values is present.","validation.missing_with_all":"The :attribute field must be missing when :values are present.","validation.multiple_of":"The :attribute field must be a multiple of :value.","validation.not_in":"The selected :attribute is invalid.","validation.not_regex":"The :attribute field format is invalid.","validation.numeric":"The :attribute field must be a number.","validation.password.letters":"The :attribute field must contain at least one letter.","validation.password.mixed":"The :attribute field must contain at least one uppercase and one lowercase letter.","validation.password.numbers":"The :attribute field must contain at least one number.","validation.password.symbols":"The :attribute field must contain at least one symbol.","validation.password.uncompromised":"The given :attribute has appeared in a data leak. Please choose a different :attribute.","validation.present":"The :attribute field must be present.","validation.present_if":"The :attribute field must be present when :other is :value.","validation.present_unless":"The :attribute field must be present unless :other is :value.","validation.present_with":"The :attribute field must be present when :values is present.","validation.present_with_all":"The :attribute field must be present when :values are present.","validation.prohibited":"The :attribute field is prohibited.","validation.prohibited_if":"The :attribute field is prohibited when :other is :value.","validation.prohibited_if_accepted":"The :attribute field is prohibited when :other is accepted.","validation.prohibited_if_declined":"The :attribute field is prohibited when :other is declined.","validation.prohibited_unless":"The :attribute field is prohibited unless :other is in :values.","validation.prohibits":"The :attribute field prohibits :other from being present.","validation.regex":"The :attribute field format is invalid.","validation.required":"The :attribute field is required.","validation.required_array_keys":"The :attribute field must contain entries for: :values.","validation.required_if":"The :attribute field is required when :other is :value.","validation.required_if_accepted":"The :attribute field is required when :other is accepted.","validation.required_if_declined":"The :attribute field is required when :other is declined.","validation.required_unless":"The :attribute field is required unless :other is in :values.","validation.required_with":"The :attribute field is required when :values is present.","validation.required_with_all":"The :attribute field is required when :values are present.","validation.required_without":"The :attribute field is required when :values is not present.","validation.required_without_all":"The :attribute field is required when none of :values are present.","validation.same":"The :attribute field must match :other.","validation.size.array":"The :attribute field must contain :size items.","validation.size.file":"The :attribute field must be :size kilobytes.","validation.size.numeric":"The :attribute field must be :size.","validation.size.string":"The :attribute field must be :size characters.","validation.starts_with":"The :attribute field must start with one of the following: :values.","validation.string":"The :attribute field must be a string.","validation.timezone":"The :attribute field must be a valid timezone.","validation.unique":"The :attribute has already been taken.","validation.uploaded":"The :attribute failed to upload.","validation.uppercase":"The :attribute field must be uppercase.","validation.url":"The :attribute field must be a valid URL.","validation.ulid":"The :attribute field must be a valid ULID.","validation.uuid":"The :attribute field must be a valid UUID.","validation.custom.attribute-name.rule-name":"custom-message","accounts.title":"Connections","accounts.page_title":"Connected Accounts","accounts.description":"Connect your social networks to schedule and publish posts","accounts.not_connected":"Not connected","accounts.connect":"Connect","accounts.connection_lost":"Connection lost","accounts.reconnect_account":"Reconnect account","accounts.view_profile":"View profile","accounts.disconnect":"Disconnect","accounts.disconnect_modal.title":"Disconnect Account","accounts.disconnect_modal.description":"Are you sure you want to disconnect this account? You can reconnect it at any time.","accounts.disconnect_modal.confirm":"Disconnect","accounts.disconnect_modal.cancel":"Cancel","accounts.bluesky.title":"Connect Bluesky","accounts.bluesky.description":"Enter your credentials to connect","accounts.bluesky.email":"Email","accounts.bluesky.email_placeholder":"yourhandle.bsky.social","accounts.bluesky.app_password":"App Password","accounts.bluesky.app_password_placeholder":"xxxx-xxxx-xxxx-xxxx","accounts.bluesky.app_password_hint":"Use an App Password for security. Create one at bsky.app/settings.","accounts.bluesky.submit":"Connect Bluesky","accounts.bluesky.submitting":"Connecting...","accounts.mastodon.title":"Connect Mastodon","accounts.mastodon.description":"Enter your Mastodon instance","accounts.mastodon.instance_url":"Instance URL","accounts.mastodon.instance_placeholder":"https://mastodon.social","accounts.mastodon.instance_hint":"Enter your Mastodon instance URL (e.g., mastodon.social, techhub.social)","accounts.mastodon.submit":"Continue with Mastodon","accounts.mastodon.submitting":"Connecting...","accounts.facebook.title":"Select Facebook Page","accounts.facebook.description":"Choose which page you want to connect","accounts.facebook.no_pages":"No pages found","accounts.facebook.no_pages_description":"You are not an admin of any Facebook page.","accounts.facebook.page_label":"Facebook Page","accounts.linkedin.title":"Select LinkedIn Page","accounts.linkedin.description":"Choose which page you want to connect","accounts.linkedin.no_pages":"No pages found","accounts.linkedin.no_pages_description":"You are not an administrator of any LinkedIn page.","accounts.linkedin.page_label":"LinkedIn Page","accounts.flash.disconnected":"Account disconnected successfully!","accounts.flash.connected":"Account connected successfully!","accounts.flash.session_expired":"Session expired. Please try again.","accounts.flash.workspace_not_found":"Workspace not found.","accounts.flash.already_connected":"This platform is already connected.","accounts.flash.no_youtube_channels":"No YouTube channels found. Please create a channel first.","auth.flash.welcome":"Welcome to TryPost!","auth.flash.welcome_trial":"Welcome to TryPost! Your trial has started.","auth.legal":"By continuing, you agree to our Terms of Service and Privacy Policy.","auth.slides.calendar.title":"Visual Calendar","auth.slides.calendar.description":"Plan and schedule your content with an intuitive drag-and-drop calendar across all your social accounts.","auth.slides.scheduling.title":"Smart Scheduling","auth.slides.scheduling.description":"Schedule posts across LinkedIn, X, Instagram, TikTok, YouTube, and more — all from one place.","auth.slides.media.title":"Rich Media","auth.slides.media.description":"Publish images, carousels, stories, and reels. Each platform gets the right format automatically.","auth.slides.video.title":"Video Publishing","auth.slides.video.description":"Upload videos once and publish to TikTok, YouTube Shorts, Instagram Reels, and Facebook Reels.","auth.slides.team.title":"Team Workspaces","auth.slides.team.description":"Invite your team, assign roles, and manage multiple brands from separate workspaces.","auth.slides.hashtags.title":"Hashtag Groups","auth.slides.hashtags.description":"Save hashtag collections and add them to posts with one click. Organize with labels and filters.","auth.login.title":"Log in to your account","auth.login.description":"Enter your email and password below to log in","auth.login.page_title":"Log in","auth.login.email":"Email address","auth.login.password":"Password","auth.login.forgot_password":"Forgot password?","auth.login.remember_me":"Remember me","auth.login.submit":"Log in","auth.login.no_account":"Don't have an account?","auth.login.sign_up":"Sign up","auth.register.title":"Create an account","auth.register.description":"Enter your details below to create your account","auth.register.page_title":"Register","auth.register.name":"Name","auth.register.name_placeholder":"Full name","auth.register.email":"Email address","auth.register.password":"Password","auth.register.show_password":"Show password","auth.register.hide_password":"Hide password","auth.register.submit":"Create account","auth.register.has_account":"Already have an account?","auth.register.log_in":"Log in","auth.forgot_password.title":"Forgot password","auth.forgot_password.description":"Enter your email to receive a password reset link","auth.forgot_password.page_title":"Forgot password","auth.forgot_password.email":"Email address","auth.forgot_password.submit":"Email password reset link","auth.forgot_password.return_to":"Or, return to","auth.forgot_password.log_in":"log in","auth.reset_password.title":"Reset password","auth.reset_password.description":"Please enter your new password below","auth.reset_password.page_title":"Reset password","auth.reset_password.email":"Email","auth.reset_password.password":"Password","auth.reset_password.confirm_password":"Confirm Password","auth.reset_password.confirm_placeholder":"Confirm password","auth.reset_password.submit":"Reset password","auth.verify_email.title":"Verify email","auth.verify_email.description":"Please verify your email address by clicking on the link we just emailed to you.","auth.verify_email.page_title":"Email verification","auth.verify_email.link_sent":"A new verification link has been sent to the email address you provided during registration.","auth.verify_email.resend":"Resend verification email","auth.verify_email.log_out":"Log out","auth.accept_invite.page_title":"Accept Invite","auth.accept_invite.title":"You've been invited!","auth.accept_invite.description":"You've been invited to join the :workspace workspace.","auth.accept_invite.workspace":"Workspace","auth.accept_invite.your_role":"Your role","auth.accept_invite.email":"Email","auth.accept_invite.accept":"Accept Invite","auth.accept_invite.decline":"Decline Invite","auth.accept_invite.login_prompt":"Log in or create an account to accept this invite.","auth.accept_invite.log_in":"Log in","auth.accept_invite.create_account":"Create Account","billing.title":"Subscription","billing.description":"Manage your subscription and payment method","billing.subscribe.page_title":"Start your free trial","billing.subscribe.title":"Start your free trial","billing.subscribe.description":":days days free. No credit card required to start.","billing.subscribe.start_trial":"Start :days-day free trial","billing.subscribe.cancel_anytime":"Cancel anytime. No questions asked.","billing.subscribe.switch_workspace":"Switch workspace","billing.subscribe.features.calendar":"Visual drag-and-drop calendar","billing.subscribe.features.scheduling":"Unlimited post scheduling","billing.subscribe.features.media":"Images, carousels & stories","billing.subscribe.features.video":"Video publishing across platforms","billing.subscribe.features.team":"Team collaboration & workspaces","billing.subscribe.features.hashtags":"Hashtag groups & labels","billing.trial.title":"Trial period active","billing.trial.description":"Your trial ends on :date. After that, your subscription will be charged automatically.","billing.subscription.title":"Your Subscription","billing.subscription.workspaces":"Workspaces","billing.subscription.quantity":"Subscription quantity","billing.subscription.expires":"Expires :date","billing.subscription.canceled_on":"Your subscription will be canceled on :date","billing.subscription.manage":"Manage on Stripe","billing.invoices.title":"Invoices","billing.invoices.description":"Payment history","billing.invoices.empty":"No invoices found","billing.invoices.paid":"Paid","billing.status.active":"Active","billing.status.canceled":"Canceled","billing.status.incomplete":"Incomplete","billing.status.incomplete_expired":"Expired","billing.status.past_due":"Past due","billing.status.trialing":"Trial","billing.status.unpaid":"Unpaid","calendar.title":"Calendar","calendar.today":"Today","calendar.day":"Day","calendar.week":"Week","calendar.month":"Month","calendar.new_post":"New Post","calendar.no_content":"No content","calendar.more":"+:count more","common.confirm_modal.cannot_be_undone":"This cannot be undone.","common.confirm_modal.type":"Type","common.confirm_modal.to_confirm":"to confirm.","common.confirm_modal.copy_to_clipboard":"Copy to clipboard","hashtags.title":"Hashtags","hashtags.description":"Create hashtag groups to quickly add to your posts","hashtags.new_group":"New Group","hashtags.no_groups_yet":"No hashtag groups yet","hashtags.no_groups_description":"Create hashtag groups to quickly add popular hashtags to your posts","hashtags.create_first_group":"Create your first group","hashtags.hashtags_count":":count hashtags","hashtags.create.title":"Create Hashtag Group","hashtags.create.description":"Give your group a name and add hashtags separated by spaces or commas","hashtags.create.name":"Group Name","hashtags.create.name_placeholder":"e.g. Marketing, Travel, Food","hashtags.create.hashtags":"Hashtags","hashtags.create.hashtags_placeholder":"#marketing #socialmedia #business #growth","hashtags.create.hashtags_hint":"Enter hashtags separated by spaces or commas. Include the # symbol.","hashtags.create.submit":"Create Group","hashtags.create.submitting":"Creating...","hashtags.edit.title":"Edit Hashtag Group","hashtags.edit.description":"Update the name and hashtags for this group","hashtags.edit.name":"Group Name","hashtags.edit.name_placeholder":"e.g. Marketing, Travel, Food","hashtags.edit.hashtags":"Hashtags","hashtags.edit.hashtags_placeholder":"#marketing #socialmedia #business #growth","hashtags.edit.hashtags_hint":"Enter hashtags separated by spaces or commas. Include the # symbol.","hashtags.edit.submit":"Save Changes","hashtags.edit.submitting":"Saving...","hashtags.delete.title":"Delete Hashtag Group","hashtags.delete.description":"Are you sure you want to delete this hashtag group? This action cannot be undone.","hashtags.delete.confirm":"Delete","hashtags.delete.cancel":"Cancel","hashtags.flash.created":"Hashtag group created successfully!","hashtags.flash.updated":"Hashtag group updated successfully!","hashtags.flash.deleted":"Hashtag group deleted successfully!","labels.title":"Labels","labels.description":"Create labels to organize and categorize your posts","labels.new_label":"New Label","labels.no_labels_yet":"No labels yet","labels.create_first_label":"Create your first label","labels.create.title":"Create Label","labels.create.description":"Give your label a name and pick a color","labels.create.name":"Name","labels.create.name_placeholder":"Enter label name...","labels.create.color":"Color","labels.create.submit":"Create Label","labels.create.submitting":"Creating...","labels.edit.title":"Edit Label","labels.edit.description":"Update the name and color for this label","labels.edit.name":"Name","labels.edit.name_placeholder":"Enter label name...","labels.edit.color":"Color","labels.edit.submit":"Save Changes","labels.edit.submitting":"Saving...","labels.delete.title":"Delete Label","labels.delete.description":"Are you sure you want to delete this label? This action cannot be undone.","labels.delete.confirm":"Delete","labels.delete.cancel":"Cancel","labels.flash.created":"Label created successfully!","labels.flash.updated":"Label updated successfully!","labels.flash.deleted":"Label deleted successfully!","mail.workspace_connections_disconnected.subject":"{1} :count account needs to be reconnected in :workspace|[2,*] :count accounts need to be reconnected in :workspace","mail.workspace_connections_disconnected.title":"Accounts Need Reconnection","mail.workspace_connections_disconnected.intro":"The following social accounts in your :workspace workspace have been disconnected and need to be reconnected:","mail.workspace_connections_disconnected.reasons_title":"This may have happened because:","mail.workspace_connections_disconnected.reason_expired":"Access tokens expired","mail.workspace_connections_disconnected.reason_revoked":"You revoked access to TryPost on the platform","mail.workspace_connections_disconnected.reason_changed":"The platform changed their authentication requirements","mail.workspace_connections_disconnected.reconnect_cta":"Please reconnect these accounts to continue scheduling and publishing posts.","mail.workspace_connections_disconnected.button":"Reconnect Accounts","posts.title":"Posts","posts.all_posts":"All Posts","posts.new_post":"New Post","posts.no_posts":"No posts found","posts.start_creating":"Start by creating your first post.","posts.manage_posts":"Manage all your posts","posts.delete_confirm":"Are you sure you want to delete this post?","posts.by":"by","posts.actions.view":"View post","posts.actions.delete":"Delete post","posts.form.post_type":"Post Type","posts.form.board":"Board","posts.form.select_board":"Select a board","posts.form.search_board":"Search board...","posts.form.no_board_found":"No board found","posts.form.media":"Media","posts.form.min":"Min","posts.form.uploading":"Uploading...","posts.form.drop_to_upload":"Drop to upload","posts.form.drag_and_drop":"Drag & drop or click to upload","posts.form.photos_and_videos":"Photos and videos","posts.form.photos_only":"Photos only","posts.form.videos_only":"Videos only","posts.form.drag_to_reorder":"Drag to reorder","posts.form.caption":"Caption","posts.form.write_caption":"Write your caption...","posts.status.draft":"Draft","posts.status.scheduled":"Scheduled","posts.status.publishing":"Publishing","posts.status.published":"Published","posts.status.partially_published":"Partially Published","posts.status.failed":"Failed","posts.descriptions.draft":"Posts waiting to be scheduled","posts.descriptions.scheduled":"Posts scheduled for publishing","posts.descriptions.published":"Posts already published","posts.edit.title":"Edit Post","posts.edit.view_title":"View Post","posts.edit.manage_platforms":"Manage platforms","posts.edit.sync":"Sync","posts.edit.labels":"Labels","posts.edit.hashtags":"Hashtags","posts.edit.schedule":"Schedule","posts.edit.publish":"Publish","posts.edit.delete":"Delete","posts.edit.settings":"Settings","posts.edit.schedule_for":"Schedule for","posts.edit.saving":"Saving...","posts.edit.saved":"Saved","posts.edit.scheduled_at":"Scheduled:","posts.edit.published_at":"Published:","posts.edit.media":"Media","posts.edit.caption":"Caption","posts.edit.no_caption":"No caption","posts.edit.no_content":"No content","posts.edit.empty_state.title":"No platforms selected","posts.edit.empty_state.description":"Select at least one platform to create your post","posts.edit.delete_modal.title":"Delete Post","posts.edit.delete_modal.description":"Are you sure you want to delete this post? This action cannot be undone.","posts.edit.delete_modal.action":"Delete","posts.edit.delete_modal.cancel":"Cancel","posts.edit.sync_enable.title":"Enable sync?","posts.edit.sync_enable.description":"All platforms will share the same content. Any custom edits made to individual platforms will be replaced with the current content.","posts.edit.sync_enable.cancel":"Cancel","posts.edit.sync_enable.action":"Enable sync","posts.edit.sync_disable.title":"Disable sync?","posts.edit.sync_disable.description":"Each platform will keep its current content, but future edits will only apply to the platform you're editing.","posts.edit.sync_disable.customize_note":"You'll be able to customize the content for each platform individually.","posts.edit.sync_disable.cancel":"Cancel","posts.edit.sync_disable.action":"Disable sync","posts.edit.platforms_dialog.title":"Select Platforms","posts.edit.platforms_dialog.description":"Choose which platforms to publish this post to.","posts.edit.hashtags_modal.search":"Search hashtags...","posts.edit.hashtags_modal.no_results":"No hashtags found.","posts.edit.validation.select_board":"Select a board","posts.edit.validation.images_not_supported":"Images not supported","posts.edit.validation.videos_not_supported":"Videos not supported","posts.edit.validation.max_images":"Max :count images","posts.edit.validation.requires_media":"Requires media","posts.edit.validation.exceeded":":count exceeded","posts.edit.validation.does_not_support_images":":platform does not support images","posts.edit.validation.supports_up_to_images":":platform supports up to :count images","posts.edit.validation.does_not_support_videos":":platform does not support videos","posts.content_types.instagram_feed.label":"Feed Post","posts.content_types.instagram_feed.description":"Appears in your feed and profile","posts.content_types.instagram_reel.label":"Reel","posts.content_types.instagram_reel.description":"Short video up to 90 seconds","posts.content_types.instagram_story.label":"Story","posts.content_types.instagram_story.description":"Disappears after 24 hours","posts.content_types.linkedin_post.label":"Post","posts.content_types.linkedin_post.description":"Standard post with text and media","posts.content_types.linkedin_carousel.label":"Carousel","posts.content_types.linkedin_carousel.description":"Swipeable images","posts.content_types.linkedin_page_post.label":"Post","posts.content_types.linkedin_page_post.description":"Standard post with text and media","posts.content_types.linkedin_page_carousel.label":"Carousel","posts.content_types.linkedin_page_carousel.description":"Swipeable images","posts.content_types.facebook_post.label":"Post","posts.content_types.facebook_post.description":"Standard post on your page","posts.content_types.facebook_reel.label":"Reel","posts.content_types.facebook_reel.description":"Short video up to 90 seconds","posts.content_types.facebook_story.label":"Story","posts.content_types.facebook_story.description":"Disappears after 24 hours","posts.content_types.tiktok_video.label":"Video","posts.content_types.tiktok_video.description":"Short-form video content","posts.content_types.youtube_short.label":"Short","posts.content_types.youtube_short.description":"Vertical video up to 60 seconds","posts.content_types.x_post.label":"Post","posts.content_types.x_post.description":"Tweet with text and media","posts.content_types.threads_post.label":"Post","posts.content_types.threads_post.description":"Text post with optional media","posts.content_types.pinterest_pin.label":"Pin","posts.content_types.pinterest_pin.description":"Image pin with link","posts.content_types.pinterest_video_pin.label":"Video Pin","posts.content_types.pinterest_video_pin.description":"Video content","posts.content_types.pinterest_carousel.label":"Carousel","posts.content_types.pinterest_carousel.description":"2-5 images","posts.content_types.bluesky_post.label":"Post","posts.content_types.bluesky_post.description":"Text post with optional images","posts.content_types.mastodon_post.label":"Post","posts.content_types.mastodon_post.description":"Text post with optional media","posts.platforms.linkedin":"LinkedIn","posts.platforms.linkedin-page":"LinkedIn Page","posts.platforms.x":"X","posts.platforms.tiktok":"TikTok","posts.platforms.youtube":"YouTube Shorts","posts.platforms.facebook":"Facebook Page","posts.platforms.instagram":"Instagram","posts.platforms.threads":"Threads","posts.platforms.pinterest":"Pinterest","posts.platforms.bluesky":"Bluesky","posts.platforms.mastodon":"Mastodon","posts.flash.scheduled":"Post scheduled successfully!","posts.flash.publishing":"Post is being published!","posts.flash.deleted":"Post deleted successfully!","posts.flash.cannot_edit_published":"Published posts cannot be edited.","posts.flash.connect_first":"Connect at least one social network before creating a post.","posts.errors.account_disconnected":"Social account is disconnected","settings.title":"Settings","settings.description":"Manage your profile and account settings","settings.nav.profile":"Profile","settings.nav.password":"Password","settings.nav.workspace":"Workspace","settings.nav.members":"Members","settings.nav.billing":"Billing","settings.profile.title":"Profile settings","settings.profile.photo_heading":"Profile photo","settings.profile.photo_description":"Upload a profile photo","settings.profile.heading":"Profile information","settings.profile.description":"Update your name and email address","settings.profile.avatar":"Avatar","settings.profile.name":"Name","settings.profile.name_placeholder":"Full name","settings.profile.email":"Email address","settings.profile.email_placeholder":"Email address","settings.profile.email_unverified":"Your email address is unverified.","settings.profile.resend_verification":"Click here to resend the verification email.","settings.profile.verification_sent":"A new verification link has been sent to your email address.","settings.profile.save":"Save","settings.password.title":"Password settings","settings.password.heading":"Update password","settings.password.description":"Ensure your account is using a long, random password to stay secure","settings.password.current_password":"Current password","settings.password.current_password_placeholder":"Current password","settings.password.new_password":"New password","settings.password.new_password_placeholder":"New password","settings.password.confirm_password":"Confirm password","settings.password.confirm_password_placeholder":"Confirm password","settings.password.save":"Save password","settings.delete_account.heading":"Delete account","settings.delete_account.description":"Delete your account and all of its resources","settings.delete_account.warning":"Warning","settings.delete_account.warning_message":"Please proceed with caution, this cannot be undone.","settings.delete_account.button":"Delete account","settings.delete_account.modal_title":"Are you sure you want to delete your account?","settings.delete_account.modal_description":"Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.","settings.delete_account.password":"Password","settings.delete_account.password_placeholder":"Password","settings.delete_account.cancel":"Cancel","settings.delete_account.confirm":"Delete account","settings.workspace.title":"Workspace settings","settings.workspace.logo_heading":"Workspace logo","settings.workspace.logo_description":"Upload a logo for your workspace","settings.workspace.heading":"Workspace name","settings.workspace.description":"Update your workspace name and timezone","settings.workspace.members_heading":"Members","settings.workspace.members_description":"Manage workspace members and invitations","settings.workspace.name":"Name","settings.workspace.name_placeholder":"My Workspace","settings.workspace.timezone":"Timezone","settings.workspace.save":"Save","settings.members.title":"Members","settings.members.heading":"Team members","settings.members.description":"Manage members and invites for this workspace","settings.members.cancel":"Cancel","settings.members.remove":"Remove","settings.members.make_admin":"Make admin","settings.members.make_member":"Make member","settings.members.invite.title":"Invite Member","settings.members.invite.description":"Send an email invite to add collaborators","settings.members.invite.email":"Email","settings.members.invite.email_placeholder":"collaborator@email.com","settings.members.invite.role":"Role","settings.members.invite.role_placeholder":"Select a role","settings.members.invite.submit":"Send Invite","settings.members.pending.title":"Pending Invites","settings.members.pending.description":"Invites awaiting acceptance","settings.members.pending.empty":"No pending invites","settings.members.list.title":"Members","settings.members.list.description":"People with access to this workspace","settings.members.list.empty":"No members besides the owner","settings.members.remove_modal.title":"Remove member","settings.members.remove_modal.description":"Are you sure you want to remove this member from the workspace? They will lose access to all workspace resources.","settings.members.remove_modal.action":"Remove member","settings.members.cancel_invite_modal.title":"Cancel invitation","settings.members.cancel_invite_modal.description":"Are you sure you want to cancel this invitation?","settings.members.cancel_invite_modal.action":"Cancel invitation","settings.members.roles.owner":"Owner","settings.members.roles.admin":"Admin","settings.members.roles.member":"Member","settings.members.flash.invite_sent":"Invite sent successfully!","settings.members.flash.invite_deleted":"Invite deleted.","settings.members.flash.member_removed":"Member removed successfully.","settings.members.flash.role_updated":"Member role updated.","settings.members.flash.wrong_email":"This invite is for a different email address.","settings.members.flash.already_member":"You are already a member of this workspace.","settings.members.flash.invite_accepted":"Welcome! You are now a member of the workspace.","settings.members.flash.invite_declined":"Invite declined.","settings.flash.profile_updated":"Profile updated successfully!","settings.flash.language_updated":"Language updated successfully!","settings.flash.password_updated":"Password updated successfully!","settings.flash.workspace_updated":"Settings updated successfully!","settings.flash.photo_updated":"Photo updated successfully!","settings.flash.photo_deleted":"Photo removed successfully!","settings.flash.logo_updated":"Logo uploaded successfully!","settings.flash.logo_deleted":"Logo removed successfully!","sidebar.workspaces":"Workspaces","sidebar.select_workspace":"Select workspace","sidebar.create_workspace":"Create workspace","sidebar.create_post":"Create post","sidebar.profile":"Profile","sidebar.log_out":"Log out","sidebar.workspace":"Workspace: :name","sidebar.workspace_select":"Workspace: Select","sidebar.theme":"Theme: :name","sidebar.theme_light":"Light","sidebar.theme_dark":"Dark","sidebar.theme_system":"System","sidebar.language":"Language: :name","sidebar.language_select":"Language: Select","sidebar.groups.posts":"Posts","sidebar.groups.configuration":"Configurations","sidebar.groups.support":"Support","sidebar.posts.calendar":"Calendar","sidebar.posts.all":"All","sidebar.posts.scheduled":"Scheduled","sidebar.posts.posted":"Posted","sidebar.posts.drafts":"Drafts","sidebar.config.connections":"Connections","sidebar.config.hashtags":"Hashtags","sidebar.config.labels":"Labels","sidebar.config.settings":"Settings","sidebar.support.discord":"Discord","sidebar.support.share_feedback":"Share feedback","sidebar.support.last_updates":"Last Updates","sidebar.support.docs":"Docs"} \ No newline at end of file diff --git a/lang/php_es.json b/lang/php_es.json new file mode 100644 index 00000000..c33358b2 --- /dev/null +++ b/lang/php_es.json @@ -0,0 +1 @@ +{"accounts.title":"Conexiones","accounts.page_title":"Cuentas conectadas","accounts.description":"Conecta tus redes sociales para programar y publicar posts","accounts.not_connected":"No conectado","accounts.connect":"Conectar","accounts.connection_lost":"Conexión perdida","accounts.reconnect_account":"Reconectar cuenta","accounts.view_profile":"Ver perfil","accounts.disconnect":"Desconectar","accounts.disconnect_modal.title":"Desconectar cuenta","accounts.disconnect_modal.description":"¿Estás seguro de que deseas desconectar esta cuenta? Puedes volver a conectarla en cualquier momento.","accounts.disconnect_modal.confirm":"Desconectar","accounts.disconnect_modal.cancel":"Cancelar","accounts.bluesky.title":"Conectar Bluesky","accounts.bluesky.description":"Introduce tus credenciales para conectar","accounts.bluesky.email":"Correo electrónico","accounts.bluesky.email_placeholder":"tuusuario.bsky.social","accounts.bluesky.app_password":"Contraseña de app","accounts.bluesky.app_password_placeholder":"xxxx-xxxx-xxxx-xxxx","accounts.bluesky.app_password_hint":"Usa una Contraseña de App por seguridad. Crea una en bsky.app/settings.","accounts.bluesky.submit":"Conectar Bluesky","accounts.bluesky.submitting":"Conectando...","accounts.mastodon.title":"Conectar Mastodon","accounts.mastodon.description":"Introduce tu instancia de Mastodon","accounts.mastodon.instance_url":"URL de la instancia","accounts.mastodon.instance_placeholder":"https://mastodon.social","accounts.mastodon.instance_hint":"Introduce la URL de tu instancia de Mastodon (ej: mastodon.social, techhub.social)","accounts.mastodon.submit":"Continuar con Mastodon","accounts.mastodon.submitting":"Conectando...","accounts.facebook.title":"Seleccionar página de Facebook","accounts.facebook.description":"Elige qué página deseas conectar","accounts.facebook.no_pages":"No se encontraron páginas","accounts.facebook.no_pages_description":"No eres administrador de ninguna página de Facebook.","accounts.facebook.page_label":"Página de Facebook","accounts.linkedin.title":"Seleccionar página de LinkedIn","accounts.linkedin.description":"Elige qué página deseas conectar","accounts.linkedin.no_pages":"No se encontraron páginas","accounts.linkedin.no_pages_description":"No eres administrador de ninguna página de LinkedIn.","accounts.linkedin.page_label":"Página de LinkedIn","accounts.flash.disconnected":"¡Cuenta desconectada correctamente!","accounts.flash.connected":"¡Cuenta conectada correctamente!","accounts.flash.session_expired":"Sesión expirada. Inténtalo de nuevo.","accounts.flash.workspace_not_found":"Workspace no encontrado.","accounts.flash.already_connected":"Esta plataforma ya está conectada.","accounts.flash.no_youtube_channels":"No se encontraron canales de YouTube. Crea un canal primero.","auth.failed":"Estas credenciales no coinciden con nuestros registros.","auth.password":"La contraseña proporcionada es incorrecta.","auth.throttle":"Demasiados intentos de inicio de sesión. Inténtalo de nuevo en :seconds segundos.","auth.flash.welcome":"¡Bienvenido a TryPost!","auth.flash.welcome_trial":"¡Bienvenido a TryPost! Tu prueba ha comenzado.","auth.legal":"Al continuar, aceptas nuestros Términos de Servicio y Política de Privacidad.","auth.slides.calendar.title":"Calendario Visual","auth.slides.calendar.description":"Planifica y programa tu contenido con un calendario intuitivo de arrastrar y soltar en todas tus cuentas sociales.","auth.slides.scheduling.title":"Programación Inteligente","auth.slides.scheduling.description":"Programa posts en LinkedIn, X, Instagram, TikTok, YouTube y más — todo desde un solo lugar.","auth.slides.media.title":"Contenido Multimedia","auth.slides.media.description":"Publica imágenes, carruseles, historias y reels. Cada plataforma recibe el formato correcto automáticamente.","auth.slides.video.title":"Publicación de Video","auth.slides.video.description":"Sube videos una vez y publícalos en TikTok, YouTube Shorts, Instagram Reels y Facebook Reels.","auth.slides.team.title":"Workspaces en Equipo","auth.slides.team.description":"Invita a tu equipo, asigna roles y gestiona múltiples marcas en workspaces separados.","auth.slides.hashtags.title":"Grupos de Hashtags","auth.slides.hashtags.description":"Guarda colecciones de hashtags y agrégalos a tus posts con un clic. Organiza con etiquetas y filtros.","auth.login.title":"Inicia sesión en tu cuenta","auth.login.description":"Introduce tu correo y contraseña para iniciar sesión","auth.login.page_title":"Iniciar sesión","auth.login.email":"Correo electrónico","auth.login.password":"Contraseña","auth.login.forgot_password":"¿Olvidaste tu contraseña?","auth.login.remember_me":"Recuérdame","auth.login.submit":"Iniciar sesión","auth.login.no_account":"¿No tienes una cuenta?","auth.login.sign_up":"Regístrate","auth.register.title":"Crear una cuenta","auth.register.description":"Introduce tus datos para crear tu cuenta","auth.register.page_title":"Registro","auth.register.name":"Nombre","auth.register.name_placeholder":"Nombre completo","auth.register.email":"Correo electrónico","auth.register.password":"Contraseña","auth.register.show_password":"Mostrar contraseña","auth.register.hide_password":"Ocultar contraseña","auth.register.submit":"Crear cuenta","auth.register.has_account":"¿Ya tienes una cuenta?","auth.register.log_in":"Iniciar sesión","auth.forgot_password.title":"Olvidé mi contraseña","auth.forgot_password.description":"Introduce tu correo para recibir un enlace de restablecimiento","auth.forgot_password.page_title":"Olvidé mi contraseña","auth.forgot_password.email":"Correo electrónico","auth.forgot_password.submit":"Enviar enlace de restablecimiento","auth.forgot_password.return_to":"O vuelve a","auth.forgot_password.log_in":"iniciar sesión","auth.reset_password.title":"Restablecer contraseña","auth.reset_password.description":"Introduce tu nueva contraseña","auth.reset_password.page_title":"Restablecer contraseña","auth.reset_password.email":"Correo electrónico","auth.reset_password.password":"Contraseña","auth.reset_password.confirm_password":"Confirmar contraseña","auth.reset_password.confirm_placeholder":"Confirmar contraseña","auth.reset_password.submit":"Restablecer contraseña","auth.verify_email.title":"Verificar correo","auth.verify_email.description":"Verifica tu correo electrónico haciendo clic en el enlace que acabamos de enviarte.","auth.verify_email.page_title":"Verificación de correo","auth.verify_email.link_sent":"Se ha enviado un nuevo enlace de verificación al correo electrónico proporcionado durante el registro.","auth.verify_email.resend":"Reenviar correo de verificación","auth.verify_email.log_out":"Cerrar sesión","auth.accept_invite.page_title":"Aceptar invitación","auth.accept_invite.title":"¡Has sido invitado!","auth.accept_invite.description":"Has sido invitado a unirte al workspace :workspace.","auth.accept_invite.workspace":"Workspace","auth.accept_invite.your_role":"Tu rol","auth.accept_invite.email":"Correo electrónico","auth.accept_invite.accept":"Aceptar invitación","auth.accept_invite.decline":"Rechazar invitación","auth.accept_invite.login_prompt":"Inicia sesión o crea una cuenta para aceptar esta invitación.","auth.accept_invite.log_in":"Iniciar sesión","auth.accept_invite.create_account":"Crear cuenta","billing.title":"Suscripción","billing.description":"Administra tu suscripción y método de pago","billing.subscribe.page_title":"Comienza tu prueba gratuita","billing.subscribe.title":"Comienza tu prueba gratuita","billing.subscribe.description":":days días gratis. Sin tarjeta de crédito para empezar.","billing.subscribe.start_trial":"Comenzar prueba de :days días","billing.subscribe.cancel_anytime":"Cancela en cualquier momento. Sin preguntas.","billing.subscribe.switch_workspace":"Cambiar workspace","billing.subscribe.features.calendar":"Calendario visual con arrastrar y soltar","billing.subscribe.features.scheduling":"Programación ilimitada de posts","billing.subscribe.features.media":"Imágenes, carruseles e historias","billing.subscribe.features.video":"Publicación de videos en todas las plataformas","billing.subscribe.features.team":"Colaboración en equipo y workspaces","billing.subscribe.features.hashtags":"Grupos de hashtags y etiquetas","billing.trial.title":"Periodo de prueba activo","billing.trial.description":"Tu prueba termina el :date. Después, tu suscripción se cobrará automáticamente.","billing.subscription.title":"Tu suscripción","billing.subscription.workspaces":"Workspaces","billing.subscription.quantity":"Cantidad de suscripción","billing.subscription.expires":"Expira :date","billing.subscription.canceled_on":"Tu suscripción se cancelará el :date","billing.subscription.manage":"Administrar en Stripe","billing.invoices.title":"Facturas","billing.invoices.description":"Historial de pagos","billing.invoices.empty":"No se encontraron facturas","billing.invoices.paid":"Pagado","billing.status.active":"Activa","billing.status.canceled":"Cancelada","billing.status.incomplete":"Incompleta","billing.status.incomplete_expired":"Expirada","billing.status.past_due":"Vencida","billing.status.trialing":"Prueba","billing.status.unpaid":"Sin pagar","calendar.title":"Calendario","calendar.today":"Hoy","calendar.day":"Día","calendar.week":"Semana","calendar.month":"Mes","calendar.new_post":"Nuevo post","calendar.no_content":"Sin contenido","calendar.more":"+:count más","common.confirm_modal.cannot_be_undone":"Esta acción no se puede deshacer.","common.confirm_modal.type":"Escribe","common.confirm_modal.to_confirm":"para confirmar.","common.confirm_modal.copy_to_clipboard":"Copiar al portapapeles","hashtags.title":"Hashtags","hashtags.description":"Crea grupos de hashtags para agregarlos rápidamente a tus posts","hashtags.new_group":"Nuevo grupo","hashtags.no_groups_yet":"Aún no hay grupos de hashtags","hashtags.no_groups_description":"Crea grupos de hashtags para agregar rápidamente hashtags populares a tus posts","hashtags.create_first_group":"Crea tu primer grupo","hashtags.hashtags_count":":count hashtags","hashtags.create.title":"Crear grupo de hashtags","hashtags.create.description":"Dale un nombre a tu grupo y agrega hashtags separados por espacios o comas","hashtags.create.name":"Nombre del grupo","hashtags.create.name_placeholder":"ej: Marketing, Viajes, Comida","hashtags.create.hashtags":"Hashtags","hashtags.create.hashtags_placeholder":"#marketing #redessociales #negocios #crecimiento","hashtags.create.hashtags_hint":"Ingresa hashtags separados por espacios o comas. Incluye el símbolo #.","hashtags.create.submit":"Crear grupo","hashtags.create.submitting":"Creando...","hashtags.edit.title":"Editar grupo de hashtags","hashtags.edit.description":"Actualiza el nombre y los hashtags de este grupo","hashtags.edit.name":"Nombre del grupo","hashtags.edit.name_placeholder":"ej: Marketing, Viajes, Comida","hashtags.edit.hashtags":"Hashtags","hashtags.edit.hashtags_placeholder":"#marketing #redessociales #negocios #crecimiento","hashtags.edit.hashtags_hint":"Ingresa hashtags separados por espacios o comas. Incluye el símbolo #.","hashtags.edit.submit":"Guardar cambios","hashtags.edit.submitting":"Guardando...","hashtags.delete.title":"Eliminar grupo de hashtags","hashtags.delete.description":"¿Estás seguro de que deseas eliminar este grupo de hashtags? Esta acción no se puede deshacer.","hashtags.delete.confirm":"Eliminar","hashtags.delete.cancel":"Cancelar","hashtags.flash.created":"¡Grupo de hashtags creado correctamente!","hashtags.flash.updated":"¡Grupo de hashtags actualizado correctamente!","hashtags.flash.deleted":"¡Grupo de hashtags eliminado correctamente!","labels.title":"Etiquetas","labels.description":"Crea etiquetas para organizar y categorizar tus posts","labels.new_label":"Nueva etiqueta","labels.no_labels_yet":"Aún no hay etiquetas","labels.create_first_label":"Crea tu primera etiqueta","labels.create.title":"Crear etiqueta","labels.create.description":"Dale un nombre y elige un color para tu etiqueta","labels.create.name":"Nombre","labels.create.name_placeholder":"Nombre de la etiqueta...","labels.create.color":"Color","labels.create.submit":"Crear etiqueta","labels.create.submitting":"Creando...","labels.edit.title":"Editar etiqueta","labels.edit.description":"Actualiza el nombre y el color de esta etiqueta","labels.edit.name":"Nombre","labels.edit.name_placeholder":"Nombre de la etiqueta...","labels.edit.color":"Color","labels.edit.submit":"Guardar cambios","labels.edit.submitting":"Guardando...","labels.delete.title":"Eliminar etiqueta","labels.delete.description":"¿Estás seguro de que deseas eliminar esta etiqueta? Esta acción no se puede deshacer.","labels.delete.confirm":"Eliminar","labels.delete.cancel":"Cancelar","labels.flash.created":"¡Etiqueta creada correctamente!","labels.flash.updated":"¡Etiqueta actualizada correctamente!","labels.flash.deleted":"¡Etiqueta eliminada correctamente!","mail.workspace_connections_disconnected.subject":"{1} :count cuenta necesita ser reconectada en :workspace|[2,*] :count cuentas necesitan ser reconectadas en :workspace","mail.workspace_connections_disconnected.title":"Cuentas necesitan reconexión","mail.workspace_connections_disconnected.intro":"Las siguientes cuentas sociales en tu workspace :workspace se han desconectado y necesitan ser reconectadas:","mail.workspace_connections_disconnected.reasons_title":"Esto puede haber ocurrido porque:","mail.workspace_connections_disconnected.reason_expired":"Los tokens de acceso expiraron","mail.workspace_connections_disconnected.reason_revoked":"Revocaste el acceso a TryPost en la plataforma","mail.workspace_connections_disconnected.reason_changed":"La plataforma cambió sus requisitos de autenticación","mail.workspace_connections_disconnected.reconnect_cta":"Reconecta estas cuentas para seguir programando y publicando posts.","mail.workspace_connections_disconnected.button":"Reconectar cuentas","pagination.previous":"« Anterior","pagination.next":"Siguiente »","passwords.reset":"Tu contraseña ha sido restablecida.","passwords.sent":"Te hemos enviado un enlace para restablecer tu contraseña.","passwords.throttled":"Espera antes de intentarlo de nuevo.","passwords.token":"Este token de restablecimiento de contraseña no es válido.","passwords.user":"No encontramos un usuario con ese correo electrónico.","posts.title":"Posts","posts.all_posts":"Todos los posts","posts.new_post":"Nuevo post","posts.no_posts":"No se encontraron posts","posts.start_creating":"Empieza creando tu primer post.","posts.manage_posts":"Administra todos tus posts","posts.delete_confirm":"¿Estás seguro de que deseas eliminar este post?","posts.by":"por","posts.actions.view":"Ver post","posts.actions.delete":"Eliminar post","posts.form.post_type":"Tipo de post","posts.form.board":"Tablero","posts.form.select_board":"Seleccionar tablero","posts.form.search_board":"Buscar tablero...","posts.form.no_board_found":"No se encontró tablero","posts.form.media":"Multimedia","posts.form.min":"Min","posts.form.uploading":"Subiendo...","posts.form.drop_to_upload":"Suelta para subir","posts.form.drag_and_drop":"Arrastra y suelta o haz clic para subir","posts.form.photos_and_videos":"Fotos y videos","posts.form.photos_only":"Solo fotos","posts.form.videos_only":"Solo videos","posts.form.drag_to_reorder":"Arrastra para reordenar","posts.form.caption":"Descripción","posts.form.write_caption":"Escribe tu descripción...","posts.status.draft":"Borrador","posts.status.scheduled":"Programado","posts.status.publishing":"Publicando","posts.status.published":"Publicado","posts.status.partially_published":"Parcialmente publicado","posts.status.failed":"Fallido","posts.descriptions.draft":"Posts esperando ser programados","posts.descriptions.scheduled":"Posts programados para publicar","posts.descriptions.published":"Posts ya publicados","posts.edit.title":"Editar post","posts.edit.view_title":"Ver post","posts.edit.manage_platforms":"Administrar plataformas","posts.edit.sync":"Sincronizar","posts.edit.labels":"Etiquetas","posts.edit.hashtags":"Hashtags","posts.edit.schedule":"Programar","posts.edit.publish":"Publicar","posts.edit.delete":"Eliminar","posts.edit.settings":"Configuración","posts.edit.schedule_for":"Programar para","posts.edit.saving":"Guardando...","posts.edit.saved":"Guardado","posts.edit.scheduled_at":"Programado:","posts.edit.published_at":"Publicado:","posts.edit.media":"Multimedia","posts.edit.caption":"Descripción","posts.edit.no_caption":"Sin descripción","posts.edit.no_content":"Sin contenido","posts.edit.empty_state.title":"No hay plataformas seleccionadas","posts.edit.empty_state.description":"Selecciona al menos una plataforma para crear tu post","posts.edit.delete_modal.title":"Eliminar post","posts.edit.delete_modal.description":"¿Estás seguro de que deseas eliminar este post? Esta acción no se puede deshacer.","posts.edit.delete_modal.action":"Eliminar","posts.edit.delete_modal.cancel":"Cancelar","posts.edit.sync_enable.title":"¿Activar sincronización?","posts.edit.sync_enable.description":"Todas las plataformas compartirán el mismo contenido. Las ediciones personalizadas realizadas en plataformas individuales serán reemplazadas con el contenido actual.","posts.edit.sync_enable.cancel":"Cancelar","posts.edit.sync_enable.action":"Activar sincronización","posts.edit.sync_disable.title":"¿Desactivar sincronización?","posts.edit.sync_disable.description":"Cada plataforma mantendrá su contenido actual, pero las ediciones futuras solo se aplicarán a la plataforma que estés editando.","posts.edit.sync_disable.customize_note":"Podrás personalizar el contenido de cada plataforma individualmente.","posts.edit.sync_disable.cancel":"Cancelar","posts.edit.sync_disable.action":"Desactivar sincronización","posts.edit.platforms_dialog.title":"Seleccionar plataformas","posts.edit.platforms_dialog.description":"Elige en qué plataformas publicar este post.","posts.edit.hashtags_modal.search":"Buscar hashtags...","posts.edit.hashtags_modal.no_results":"No se encontraron hashtags.","posts.edit.validation.select_board":"Selecciona un tablero","posts.edit.validation.images_not_supported":"Imágenes no soportadas","posts.edit.validation.videos_not_supported":"Videos no soportados","posts.edit.validation.max_images":"Máximo :count imágenes","posts.edit.validation.requires_media":"Requiere multimedia","posts.edit.validation.exceeded":":count excedido","posts.edit.validation.does_not_support_images":":platform no soporta imágenes","posts.edit.validation.supports_up_to_images":":platform soporta hasta :count imágenes","posts.edit.validation.does_not_support_videos":":platform no soporta videos","posts.content_types.instagram_feed.label":"Post del feed","posts.content_types.instagram_feed.description":"Aparece en tu feed y perfil","posts.content_types.instagram_reel.label":"Reel","posts.content_types.instagram_reel.description":"Video corto de hasta 90 segundos","posts.content_types.instagram_story.label":"Historia","posts.content_types.instagram_story.description":"Desaparece después de 24 horas","posts.content_types.linkedin_post.label":"Post","posts.content_types.linkedin_post.description":"Post estándar con texto y multimedia","posts.content_types.linkedin_carousel.label":"Carrusel","posts.content_types.linkedin_carousel.description":"Imágenes deslizables","posts.content_types.linkedin_page_post.label":"Post","posts.content_types.linkedin_page_post.description":"Post estándar con texto y multimedia","posts.content_types.linkedin_page_carousel.label":"Carrusel","posts.content_types.linkedin_page_carousel.description":"Imágenes deslizables","posts.content_types.facebook_post.label":"Post","posts.content_types.facebook_post.description":"Post estándar en tu página","posts.content_types.facebook_reel.label":"Reel","posts.content_types.facebook_reel.description":"Video corto de hasta 90 segundos","posts.content_types.facebook_story.label":"Historia","posts.content_types.facebook_story.description":"Desaparece después de 24 horas","posts.content_types.tiktok_video.label":"Video","posts.content_types.tiktok_video.description":"Contenido de video corto","posts.content_types.youtube_short.label":"Short","posts.content_types.youtube_short.description":"Video vertical de hasta 60 segundos","posts.content_types.x_post.label":"Post","posts.content_types.x_post.description":"Tweet con texto y multimedia","posts.content_types.threads_post.label":"Post","posts.content_types.threads_post.description":"Post de texto con multimedia opcional","posts.content_types.pinterest_pin.label":"Pin","posts.content_types.pinterest_pin.description":"Pin de imagen con enlace","posts.content_types.pinterest_video_pin.label":"Pin de video","posts.content_types.pinterest_video_pin.description":"Contenido de video","posts.content_types.pinterest_carousel.label":"Carrusel","posts.content_types.pinterest_carousel.description":"2-5 imágenes","posts.content_types.bluesky_post.label":"Post","posts.content_types.bluesky_post.description":"Post de texto con imágenes opcionales","posts.content_types.mastodon_post.label":"Post","posts.content_types.mastodon_post.description":"Post de texto con multimedia opcional","posts.platforms.linkedin":"LinkedIn","posts.platforms.linkedin-page":"Página de LinkedIn","posts.platforms.x":"X","posts.platforms.tiktok":"TikTok","posts.platforms.youtube":"YouTube Shorts","posts.platforms.facebook":"Página de Facebook","posts.platforms.instagram":"Instagram","posts.platforms.threads":"Threads","posts.platforms.pinterest":"Pinterest","posts.platforms.bluesky":"Bluesky","posts.platforms.mastodon":"Mastodon","posts.flash.scheduled":"¡Post programado correctamente!","posts.flash.publishing":"¡El post se está publicando!","posts.flash.deleted":"¡Post eliminado correctamente!","posts.flash.cannot_edit_published":"Los posts publicados no se pueden editar.","posts.flash.connect_first":"Conecta al menos una red social antes de crear un post.","posts.errors.account_disconnected":"Cuenta social desconectada","settings.title":"Configuración","settings.description":"Administra tu perfil y configuración de la cuenta","settings.nav.profile":"Perfil","settings.nav.password":"Contraseña","settings.nav.workspace":"Workspace","settings.nav.members":"Miembros","settings.nav.billing":"Facturación","settings.profile.title":"Configuración del perfil","settings.profile.photo_heading":"Foto de perfil","settings.profile.photo_description":"Sube una foto de perfil","settings.profile.heading":"Información del perfil","settings.profile.description":"Actualiza tu nombre y correo electrónico","settings.profile.avatar":"Avatar","settings.profile.name":"Nombre","settings.profile.name_placeholder":"Nombre completo","settings.profile.email":"Correo electrónico","settings.profile.email_placeholder":"Correo electrónico","settings.profile.email_unverified":"Tu correo electrónico no ha sido verificado.","settings.profile.resend_verification":"Haz clic aquí para reenviar el correo de verificación.","settings.profile.verification_sent":"Se ha enviado un nuevo enlace de verificación a tu correo electrónico.","settings.profile.save":"Guardar","settings.password.title":"Configuración de contraseña","settings.password.heading":"Actualizar contraseña","settings.password.description":"Asegúrate de que tu cuenta use una contraseña larga y aleatoria para mantenerte seguro","settings.password.current_password":"Contraseña actual","settings.password.current_password_placeholder":"Contraseña actual","settings.password.new_password":"Nueva contraseña","settings.password.new_password_placeholder":"Nueva contraseña","settings.password.confirm_password":"Confirmar contraseña","settings.password.confirm_password_placeholder":"Confirmar contraseña","settings.password.save":"Guardar contraseña","settings.delete_account.heading":"Eliminar cuenta","settings.delete_account.description":"Elimina tu cuenta y todos sus recursos","settings.delete_account.warning":"Advertencia","settings.delete_account.warning_message":"Procede con precaución, esta acción no se puede deshacer.","settings.delete_account.button":"Eliminar cuenta","settings.delete_account.modal_title":"¿Estás seguro de que deseas eliminar tu cuenta?","settings.delete_account.modal_description":"Una vez eliminada tu cuenta, todos sus recursos y datos también se eliminarán permanentemente. Introduce tu contraseña para confirmar que deseas eliminar permanentemente tu cuenta.","settings.delete_account.password":"Contraseña","settings.delete_account.password_placeholder":"Contraseña","settings.delete_account.cancel":"Cancelar","settings.delete_account.confirm":"Eliminar cuenta","settings.workspace.title":"Configuración del workspace","settings.workspace.logo_heading":"Logo del workspace","settings.workspace.logo_description":"Sube un logo para tu workspace","settings.workspace.heading":"Nombre del workspace","settings.workspace.description":"Actualiza el nombre y zona horaria del workspace","settings.workspace.members_heading":"Miembros","settings.workspace.members_description":"Administra miembros e invitaciones del workspace","settings.workspace.name":"Nombre","settings.workspace.name_placeholder":"Mi Workspace","settings.workspace.timezone":"Zona horaria","settings.workspace.save":"Guardar","settings.members.title":"Miembros","settings.members.heading":"Miembros del equipo","settings.members.description":"Administra miembros e invitaciones de este workspace","settings.members.cancel":"Cancelar","settings.members.remove":"Eliminar","settings.members.make_admin":"Hacer administrador","settings.members.make_member":"Hacer miembro","settings.members.invite.title":"Invitar miembro","settings.members.invite.description":"Envía una invitación por correo para agregar colaboradores","settings.members.invite.email":"Correo electrónico","settings.members.invite.email_placeholder":"colaborador@email.com","settings.members.invite.role":"Rol","settings.members.invite.role_placeholder":"Selecciona un rol","settings.members.invite.submit":"Enviar invitación","settings.members.pending.title":"Invitaciones pendientes","settings.members.pending.description":"Invitaciones en espera de aceptación","settings.members.pending.empty":"No hay invitaciones pendientes","settings.members.list.title":"Miembros","settings.members.list.description":"Personas con acceso a este workspace","settings.members.list.empty":"No hay miembros además del propietario","settings.members.remove_modal.title":"Eliminar miembro","settings.members.remove_modal.description":"¿Estás seguro de que deseas eliminar a este miembro del workspace? Perderá acceso a todos los recursos del workspace.","settings.members.remove_modal.action":"Eliminar miembro","settings.members.cancel_invite_modal.title":"Cancelar invitación","settings.members.cancel_invite_modal.description":"¿Estás seguro de que deseas cancelar esta invitación?","settings.members.cancel_invite_modal.action":"Cancelar invitación","settings.members.roles.owner":"Propietario","settings.members.roles.admin":"Administrador","settings.members.roles.member":"Miembro","settings.members.flash.invite_sent":"¡Invitación enviada correctamente!","settings.members.flash.invite_deleted":"Invitación eliminada.","settings.members.flash.member_removed":"¡Miembro eliminado correctamente!","settings.members.flash.role_updated":"Rol del miembro actualizado.","settings.members.flash.wrong_email":"Esta invitación es para otro correo electrónico.","settings.members.flash.already_member":"Ya eres miembro de este workspace.","settings.members.flash.invite_accepted":"¡Bienvenido! Ahora eres miembro del workspace.","settings.members.flash.invite_declined":"Invitación rechazada.","settings.flash.profile_updated":"¡Perfil actualizado correctamente!","settings.flash.language_updated":"¡Idioma actualizado correctamente!","settings.flash.password_updated":"¡Contraseña actualizada correctamente!","settings.flash.workspace_updated":"¡Configuración actualizada correctamente!","settings.flash.photo_updated":"¡Foto actualizada correctamente!","settings.flash.photo_deleted":"¡Foto eliminada correctamente!","settings.flash.logo_updated":"¡Logo subido correctamente!","settings.flash.logo_deleted":"¡Logo eliminado correctamente!","sidebar.workspaces":"Workspaces","sidebar.select_workspace":"Seleccionar workspace","sidebar.create_workspace":"Crear workspace","sidebar.create_post":"Crear post","sidebar.profile":"Perfil","sidebar.log_out":"Cerrar sesión","sidebar.workspace":"Workspace: :name","sidebar.workspace_select":"Workspace: Seleccionar","sidebar.theme":"Tema: :name","sidebar.theme_light":"Claro","sidebar.theme_dark":"Oscuro","sidebar.theme_system":"Sistema","sidebar.language":"Idioma: :name","sidebar.language_select":"Idioma: Seleccionar","sidebar.groups.posts":"Posts","sidebar.groups.configuration":"Configuración","sidebar.groups.support":"Soporte","sidebar.posts.calendar":"Calendario","sidebar.posts.all":"Todos","sidebar.posts.scheduled":"Programados","sidebar.posts.posted":"Publicados","sidebar.posts.drafts":"Borradores","sidebar.config.connections":"Conexiones","sidebar.config.hashtags":"Hashtags","sidebar.config.labels":"Etiquetas","sidebar.config.settings":"Configuración","sidebar.support.discord":"Discord","sidebar.support.share_feedback":"Dar feedback","sidebar.support.last_updates":"Últimas actualizaciones","sidebar.support.docs":"Documentación","validation.accepted":"El campo :attribute debe ser aceptado.","validation.accepted_if":"El campo :attribute debe ser aceptado cuando :other es :value.","validation.active_url":"El campo :attribute debe ser una URL válida.","validation.after":"El campo :attribute debe ser una fecha posterior a :date.","validation.after_or_equal":"El campo :attribute debe ser una fecha posterior o igual a :date.","validation.alpha":"El campo :attribute solo puede contener letras.","validation.alpha_dash":"El campo :attribute solo puede contener letras, números, guiones y guiones bajos.","validation.alpha_num":"El campo :attribute solo puede contener letras y números.","validation.any_of":"El campo :attribute no es válido.","validation.array":"El campo :attribute debe ser un arreglo.","validation.ascii":"El campo :attribute solo puede contener caracteres alfanuméricos de un byte y símbolos.","validation.before":"El campo :attribute debe ser una fecha anterior a :date.","validation.before_or_equal":"El campo :attribute debe ser una fecha anterior o igual a :date.","validation.between.array":"El campo :attribute debe tener entre :min y :max elementos.","validation.between.file":"El campo :attribute debe pesar entre :min y :max kilobytes.","validation.between.numeric":"El campo :attribute debe estar entre :min y :max.","validation.between.string":"El campo :attribute debe tener entre :min y :max caracteres.","validation.boolean":"El campo :attribute debe ser verdadero o falso.","validation.can":"El campo :attribute contiene un valor no autorizado.","validation.confirmed":"La confirmación del campo :attribute no coincide.","validation.contains":"Al campo :attribute le falta un valor requerido.","validation.current_password":"La contraseña es incorrecta.","validation.date":"El campo :attribute debe ser una fecha válida.","validation.date_equals":"El campo :attribute debe ser una fecha igual a :date.","validation.date_format":"El campo :attribute debe coincidir con el formato :format.","validation.decimal":"El campo :attribute debe tener :decimal decimales.","validation.declined":"El campo :attribute debe ser rechazado.","validation.declined_if":"El campo :attribute debe ser rechazado cuando :other es :value.","validation.different":"El campo :attribute y :other deben ser diferentes.","validation.digits":"El campo :attribute debe tener :digits dígitos.","validation.digits_between":"El campo :attribute debe tener entre :min y :max dígitos.","validation.dimensions":"El campo :attribute tiene dimensiones de imagen no válidas.","validation.distinct":"El campo :attribute tiene un valor duplicado.","validation.doesnt_contain":"El campo :attribute no debe contener ninguno de los siguientes: :values.","validation.doesnt_end_with":"El campo :attribute no debe terminar con uno de los siguientes: :values.","validation.doesnt_start_with":"El campo :attribute no debe comenzar con uno de los siguientes: :values.","validation.email":"El campo :attribute debe ser un correo electrónico válido.","validation.encoding":"El campo :attribute debe estar codificado en :encoding.","validation.ends_with":"El campo :attribute debe terminar con uno de los siguientes: :values.","validation.enum":"El :attribute seleccionado no es válido.","validation.exists":"El :attribute seleccionado no es válido.","validation.extensions":"El campo :attribute debe tener una de las siguientes extensiones: :values.","validation.file":"El campo :attribute debe ser un archivo.","validation.filled":"El campo :attribute debe tener un valor.","validation.gt.array":"El campo :attribute debe tener más de :value elementos.","validation.gt.file":"El campo :attribute debe pesar más de :value kilobytes.","validation.gt.numeric":"El campo :attribute debe ser mayor que :value.","validation.gt.string":"El campo :attribute debe tener más de :value caracteres.","validation.gte.array":"El campo :attribute debe tener :value elementos o más.","validation.gte.file":"El campo :attribute debe pesar :value kilobytes o más.","validation.gte.numeric":"El campo :attribute debe ser mayor o igual a :value.","validation.gte.string":"El campo :attribute debe tener :value caracteres o más.","validation.hex_color":"El campo :attribute debe ser un color hexadecimal válido.","validation.image":"El campo :attribute debe ser una imagen.","validation.in":"El :attribute seleccionado no es válido.","validation.in_array":"El campo :attribute debe existir en :other.","validation.in_array_keys":"El campo :attribute debe contener al menos una de las siguientes claves: :values.","validation.integer":"El campo :attribute debe ser un número entero.","validation.ip":"El campo :attribute debe ser una dirección IP válida.","validation.ipv4":"El campo :attribute debe ser una dirección IPv4 válida.","validation.ipv6":"El campo :attribute debe ser una dirección IPv6 válida.","validation.json":"El campo :attribute debe ser una cadena JSON válida.","validation.list":"El campo :attribute debe ser una lista.","validation.lowercase":"El campo :attribute debe estar en minúsculas.","validation.lt.array":"El campo :attribute debe tener menos de :value elementos.","validation.lt.file":"El campo :attribute debe pesar menos de :value kilobytes.","validation.lt.numeric":"El campo :attribute debe ser menor que :value.","validation.lt.string":"El campo :attribute debe tener menos de :value caracteres.","validation.lte.array":"El campo :attribute no debe tener más de :value elementos.","validation.lte.file":"El campo :attribute debe pesar :value kilobytes o menos.","validation.lte.numeric":"El campo :attribute debe ser menor o igual a :value.","validation.lte.string":"El campo :attribute debe tener :value caracteres o menos.","validation.mac_address":"El campo :attribute debe ser una dirección MAC válida.","validation.max.array":"El campo :attribute no debe tener más de :max elementos.","validation.max.file":"El campo :attribute no debe pesar más de :max kilobytes.","validation.max.numeric":"El campo :attribute no debe ser mayor que :max.","validation.max.string":"El campo :attribute no debe tener más de :max caracteres.","validation.max_digits":"El campo :attribute no debe tener más de :max dígitos.","validation.mimes":"El campo :attribute debe ser un archivo de tipo: :values.","validation.mimetypes":"El campo :attribute debe ser un archivo de tipo: :values.","validation.min.array":"El campo :attribute debe tener al menos :min elementos.","validation.min.file":"El campo :attribute debe pesar al menos :min kilobytes.","validation.min.numeric":"El campo :attribute debe ser al menos :min.","validation.min.string":"El campo :attribute debe tener al menos :min caracteres.","validation.min_digits":"El campo :attribute debe tener al menos :min dígitos.","validation.missing":"El campo :attribute debe estar ausente.","validation.missing_if":"El campo :attribute debe estar ausente cuando :other es :value.","validation.missing_unless":"El campo :attribute debe estar ausente a menos que :other sea :value.","validation.missing_with":"El campo :attribute debe estar ausente cuando :values está presente.","validation.missing_with_all":"El campo :attribute debe estar ausente cuando :values están presentes.","validation.multiple_of":"El campo :attribute debe ser múltiplo de :value.","validation.not_in":"El :attribute seleccionado no es válido.","validation.not_regex":"El formato del campo :attribute no es válido.","validation.numeric":"El campo :attribute debe ser un número.","validation.password.letters":"El campo :attribute debe contener al menos una letra.","validation.password.mixed":"El campo :attribute debe contener al menos una letra mayúscula y una minúscula.","validation.password.numbers":"El campo :attribute debe contener al menos un número.","validation.password.symbols":"El campo :attribute debe contener al menos un símbolo.","validation.password.uncompromised":"El :attribute proporcionado ha aparecido en una filtración de datos. Elige un :attribute diferente.","validation.present":"El campo :attribute debe estar presente.","validation.present_if":"El campo :attribute debe estar presente cuando :other es :value.","validation.present_unless":"El campo :attribute debe estar presente a menos que :other sea :value.","validation.present_with":"El campo :attribute debe estar presente cuando :values está presente.","validation.present_with_all":"El campo :attribute debe estar presente cuando :values están presentes.","validation.prohibited":"El campo :attribute está prohibido.","validation.prohibited_if":"El campo :attribute está prohibido cuando :other es :value.","validation.prohibited_if_accepted":"El campo :attribute está prohibido cuando :other es aceptado.","validation.prohibited_if_declined":"El campo :attribute está prohibido cuando :other es rechazado.","validation.prohibited_unless":"El campo :attribute está prohibido a menos que :other esté en :values.","validation.prohibits":"El campo :attribute prohíbe que :other esté presente.","validation.regex":"El formato del campo :attribute no es válido.","validation.required":"El campo :attribute es obligatorio.","validation.required_array_keys":"El campo :attribute debe contener entradas para: :values.","validation.required_if":"El campo :attribute es obligatorio cuando :other es :value.","validation.required_if_accepted":"El campo :attribute es obligatorio cuando :other es aceptado.","validation.required_if_declined":"El campo :attribute es obligatorio cuando :other es rechazado.","validation.required_unless":"El campo :attribute es obligatorio a menos que :other esté en :values.","validation.required_with":"El campo :attribute es obligatorio cuando :values está presente.","validation.required_with_all":"El campo :attribute es obligatorio cuando :values están presentes.","validation.required_without":"El campo :attribute es obligatorio cuando :values no está presente.","validation.required_without_all":"El campo :attribute es obligatorio cuando ninguno de :values está presente.","validation.same":"El campo :attribute debe coincidir con :other.","validation.size.array":"El campo :attribute debe contener :size elementos.","validation.size.file":"El campo :attribute debe pesar :size kilobytes.","validation.size.numeric":"El campo :attribute debe ser :size.","validation.size.string":"El campo :attribute debe tener :size caracteres.","validation.starts_with":"El campo :attribute debe comenzar con uno de los siguientes: :values.","validation.string":"El campo :attribute debe ser una cadena de texto.","validation.timezone":"El campo :attribute debe ser una zona horaria válida.","validation.unique":"El :attribute ya ha sido registrado.","validation.uploaded":"El :attribute no se pudo subir.","validation.uppercase":"El campo :attribute debe estar en mayúsculas.","validation.url":"El campo :attribute debe ser una URL válida.","validation.ulid":"El campo :attribute debe ser un ULID válido.","validation.uuid":"El campo :attribute debe ser un UUID válido.","validation.custom.attribute-name.rule-name":"custom-message"} \ No newline at end of file diff --git a/lang/php_pt-BR.json b/lang/php_pt-BR.json new file mode 100644 index 00000000..3d9a5e7a --- /dev/null +++ b/lang/php_pt-BR.json @@ -0,0 +1 @@ +{"accounts.title":"Conexões","accounts.page_title":"Contas Conectadas","accounts.description":"Conecte suas redes sociais para agendar e publicar posts","accounts.not_connected":"Não conectado","accounts.connect":"Conectar","accounts.connection_lost":"Conexão perdida","accounts.reconnect_account":"Reconectar conta","accounts.view_profile":"Ver perfil","accounts.disconnect":"Desconectar","accounts.disconnect_modal.title":"Desconectar Conta","accounts.disconnect_modal.description":"Tem certeza que deseja desconectar esta conta? Você pode reconectá-la a qualquer momento.","accounts.disconnect_modal.confirm":"Desconectar","accounts.disconnect_modal.cancel":"Cancelar","accounts.bluesky.title":"Conectar Bluesky","accounts.bluesky.description":"Digite suas credenciais para conectar","accounts.bluesky.email":"E-mail","accounts.bluesky.email_placeholder":"seuhandle.bsky.social","accounts.bluesky.app_password":"Senha do App","accounts.bluesky.app_password_placeholder":"xxxx-xxxx-xxxx-xxxx","accounts.bluesky.app_password_hint":"Use uma Senha do App por segurança. Crie uma em bsky.app/settings.","accounts.bluesky.submit":"Conectar Bluesky","accounts.bluesky.submitting":"Conectando...","accounts.mastodon.title":"Conectar Mastodon","accounts.mastodon.description":"Digite a instância do seu Mastodon","accounts.mastodon.instance_url":"URL da Instância","accounts.mastodon.instance_placeholder":"https://mastodon.social","accounts.mastodon.instance_hint":"Digite a URL da sua instância Mastodon (ex: mastodon.social, techhub.social)","accounts.mastodon.submit":"Continuar com Mastodon","accounts.mastodon.submitting":"Conectando...","accounts.facebook.title":"Selecionar Página do Facebook","accounts.facebook.description":"Escolha qual página você deseja conectar","accounts.facebook.no_pages":"Nenhuma página encontrada","accounts.facebook.no_pages_description":"Você não é administrador de nenhuma página do Facebook.","accounts.facebook.page_label":"Página do Facebook","accounts.linkedin.title":"Selecionar Página do LinkedIn","accounts.linkedin.description":"Escolha qual página você deseja conectar","accounts.linkedin.no_pages":"Nenhuma página encontrada","accounts.linkedin.no_pages_description":"Você não é administrador de nenhuma página do LinkedIn.","accounts.linkedin.page_label":"Página do LinkedIn","accounts.flash.disconnected":"Conta desconectada com sucesso!","accounts.flash.connected":"Conta conectada com sucesso!","accounts.flash.session_expired":"Sessão expirada. Por favor, tente novamente.","accounts.flash.workspace_not_found":"Workspace não encontrado.","accounts.flash.already_connected":"Esta plataforma já está conectada.","accounts.flash.no_youtube_channels":"Nenhum canal do YouTube encontrado. Por favor, crie um canal primeiro.","auth.failed":"Essas credenciais não correspondem aos nossos registros.","auth.password":"A senha fornecida está incorreta.","auth.throttle":"Muitas tentativas de login. Por favor, tente novamente em :seconds segundos.","auth.flash.welcome":"Bem-vindo ao TryPost!","auth.flash.welcome_trial":"Bem-vindo ao TryPost! Seu período de teste começou.","auth.legal":"Ao continuar, você concorda com nossos Termos de Serviço e Política de Privacidade.","auth.slides.calendar.title":"Calendário Visual","auth.slides.calendar.description":"Planeje e agende seu conteúdo com um calendário intuitivo de arrastar e soltar em todas as suas contas sociais.","auth.slides.scheduling.title":"Agendamento Inteligente","auth.slides.scheduling.description":"Agende posts no LinkedIn, X, Instagram, TikTok, YouTube e mais — tudo em um só lugar.","auth.slides.media.title":"Mídia Rica","auth.slides.media.description":"Publique imagens, carrosséis, stories e reels. Cada plataforma recebe o formato correto automaticamente.","auth.slides.video.title":"Publicação de Vídeo","auth.slides.video.description":"Envie vídeos uma vez e publique no TikTok, YouTube Shorts, Instagram Reels e Facebook Reels.","auth.slides.team.title":"Workspaces em Equipe","auth.slides.team.description":"Convide sua equipe, atribua funções e gerencie múltiplas marcas em workspaces separados.","auth.slides.hashtags.title":"Grupos de Hashtags","auth.slides.hashtags.description":"Salve coleções de hashtags e adicione aos posts com um clique. Organize com etiquetas e filtros.","auth.login.title":"Entrar na sua conta","auth.login.description":"Digite seu email e senha abaixo para entrar","auth.login.page_title":"Entrar","auth.login.email":"Endereço de email","auth.login.password":"Senha","auth.login.forgot_password":"Esqueceu a senha?","auth.login.remember_me":"Lembrar de mim","auth.login.submit":"Entrar","auth.login.no_account":"Não tem uma conta?","auth.login.sign_up":"Cadastre-se","auth.register.title":"Criar uma conta","auth.register.description":"Digite seus dados abaixo para criar sua conta","auth.register.page_title":"Cadastro","auth.register.name":"Nome","auth.register.name_placeholder":"Nome completo","auth.register.email":"Endereço de email","auth.register.password":"Senha","auth.register.show_password":"Mostrar senha","auth.register.hide_password":"Esconder senha","auth.register.submit":"Criar conta","auth.register.has_account":"Já tem uma conta?","auth.register.log_in":"Entrar","auth.forgot_password.title":"Esqueceu a senha","auth.forgot_password.description":"Digite seu email para receber um link de redefinição de senha","auth.forgot_password.page_title":"Esqueceu a senha","auth.forgot_password.email":"Endereço de email","auth.forgot_password.submit":"Enviar link de redefinição","auth.forgot_password.return_to":"Ou, volte para","auth.forgot_password.log_in":"entrar","auth.reset_password.title":"Redefinir senha","auth.reset_password.description":"Por favor, digite sua nova senha abaixo","auth.reset_password.page_title":"Redefinir senha","auth.reset_password.email":"Email","auth.reset_password.password":"Senha","auth.reset_password.confirm_password":"Confirmar Senha","auth.reset_password.confirm_placeholder":"Confirmar senha","auth.reset_password.submit":"Redefinir senha","auth.verify_email.title":"Verificar email","auth.verify_email.description":"Por favor, verifique seu endereço de email clicando no link que acabamos de enviar.","auth.verify_email.page_title":"Verificação de email","auth.verify_email.link_sent":"Um novo link de verificação foi enviado para o endereço de email que você forneceu durante o cadastro.","auth.verify_email.resend":"Reenviar email de verificação","auth.verify_email.log_out":"Sair","auth.accept_invite.page_title":"Aceitar Convite","auth.accept_invite.title":"Você foi convidado!","auth.accept_invite.description":"Você foi convidado para participar do workspace :workspace.","auth.accept_invite.workspace":"Workspace","auth.accept_invite.your_role":"Seu cargo","auth.accept_invite.email":"Email","auth.accept_invite.accept":"Aceitar Convite","auth.accept_invite.decline":"Recusar Convite","auth.accept_invite.login_prompt":"Entre ou crie uma conta para aceitar este convite.","auth.accept_invite.log_in":"Entrar","auth.accept_invite.create_account":"Criar Conta","billing.title":"Assinatura","billing.description":"Gerencie sua assinatura e método de pagamento","billing.subscribe.page_title":"Comece seu teste gratuito","billing.subscribe.title":"Comece seu teste gratuito","billing.subscribe.description":":days dias grátis. Sem cartão de crédito para começar.","billing.subscribe.start_trial":"Começar teste de :days dias","billing.subscribe.cancel_anytime":"Cancele a qualquer momento. Sem perguntas.","billing.subscribe.switch_workspace":"Trocar workspace","billing.subscribe.features.calendar":"Calendário visual com arrastar e soltar","billing.subscribe.features.scheduling":"Agendamento ilimitado de posts","billing.subscribe.features.media":"Imagens, carrosséis e stories","billing.subscribe.features.video":"Publicação de vídeos em todas as plataformas","billing.subscribe.features.team":"Colaboração em equipe e workspaces","billing.subscribe.features.hashtags":"Grupos de hashtags e etiquetas","billing.trial.title":"Período de teste ativo","billing.trial.description":"Seu período de teste termina em :date. Após isso, sua assinatura será cobrada automaticamente.","billing.subscription.title":"Sua Assinatura","billing.subscription.workspaces":"Workspaces","billing.subscription.quantity":"Quantidade da assinatura","billing.subscription.expires":"Expira em :date","billing.subscription.canceled_on":"Sua assinatura será cancelada em :date","billing.subscription.manage":"Gerenciar no Stripe","billing.invoices.title":"Faturas","billing.invoices.description":"Histórico de pagamentos","billing.invoices.empty":"Nenhuma fatura encontrada","billing.invoices.paid":"Pago","billing.status.active":"Ativo","billing.status.canceled":"Cancelado","billing.status.incomplete":"Incompleto","billing.status.incomplete_expired":"Expirado","billing.status.past_due":"Vencido","billing.status.trialing":"Teste","billing.status.unpaid":"Não pago","calendar.title":"Calendário","calendar.today":"Hoje","calendar.day":"Dia","calendar.week":"Semana","calendar.month":"Mês","calendar.new_post":"Novo Post","calendar.no_content":"Sem conteúdo","calendar.more":"+:count mais","common.confirm_modal.cannot_be_undone":"Esta ação não pode ser desfeita.","common.confirm_modal.type":"Digite","common.confirm_modal.to_confirm":"para confirmar.","common.confirm_modal.copy_to_clipboard":"Copiar para a área de transferência","hashtags.title":"Hashtags","hashtags.description":"Crie grupos de hashtags para adicionar rapidamente aos seus posts","hashtags.new_group":"Novo Grupo","hashtags.no_groups_yet":"Nenhum grupo de hashtags ainda","hashtags.no_groups_description":"Crie grupos de hashtags para adicionar rapidamente hashtags populares aos seus posts","hashtags.create_first_group":"Crie seu primeiro grupo","hashtags.hashtags_count":":count hashtags","hashtags.create.title":"Criar Grupo de Hashtags","hashtags.create.description":"Dê um nome ao grupo e adicione hashtags separadas por espaços ou vírgulas","hashtags.create.name":"Nome do Grupo","hashtags.create.name_placeholder":"ex: Marketing, Viagem, Comida","hashtags.create.hashtags":"Hashtags","hashtags.create.hashtags_placeholder":"#marketing #redessociais #negocios #crescimento","hashtags.create.hashtags_hint":"Digite as hashtags separadas por espaços ou vírgulas. Inclua o símbolo #.","hashtags.create.submit":"Criar Grupo","hashtags.create.submitting":"Criando...","hashtags.edit.title":"Editar Grupo de Hashtags","hashtags.edit.description":"Atualize o nome e as hashtags deste grupo","hashtags.edit.name":"Nome do Grupo","hashtags.edit.name_placeholder":"ex: Marketing, Viagem, Comida","hashtags.edit.hashtags":"Hashtags","hashtags.edit.hashtags_placeholder":"#marketing #redessociais #negocios #crescimento","hashtags.edit.hashtags_hint":"Digite as hashtags separadas por espaços ou vírgulas. Inclua o símbolo #.","hashtags.edit.submit":"Salvar Alterações","hashtags.edit.submitting":"Salvando...","hashtags.delete.title":"Excluir Grupo de Hashtags","hashtags.delete.description":"Tem certeza que deseja excluir este grupo de hashtags? Esta ação não pode ser desfeita.","hashtags.delete.confirm":"Excluir","hashtags.delete.cancel":"Cancelar","hashtags.flash.created":"Grupo de hashtags criado com sucesso!","hashtags.flash.updated":"Grupo de hashtags atualizado com sucesso!","hashtags.flash.deleted":"Grupo de hashtags excluído com sucesso!","labels.title":"Etiquetas","labels.description":"Crie etiquetas para organizar e categorizar seus posts","labels.new_label":"Nova Etiqueta","labels.no_labels_yet":"Nenhuma etiqueta ainda","labels.create_first_label":"Crie sua primeira etiqueta","labels.create.title":"Criar Etiqueta","labels.create.description":"Dê um nome e escolha uma cor para sua etiqueta","labels.create.name":"Nome","labels.create.name_placeholder":"Digite o nome da etiqueta...","labels.create.color":"Cor","labels.create.submit":"Criar Etiqueta","labels.create.submitting":"Criando...","labels.edit.title":"Editar Etiqueta","labels.edit.description":"Atualize o nome e a cor desta etiqueta","labels.edit.name":"Nome","labels.edit.name_placeholder":"Digite o nome da etiqueta...","labels.edit.color":"Cor","labels.edit.submit":"Salvar Alterações","labels.edit.submitting":"Salvando...","labels.delete.title":"Excluir Etiqueta","labels.delete.description":"Tem certeza que deseja excluir esta etiqueta? Esta ação não pode ser desfeita.","labels.delete.confirm":"Excluir","labels.delete.cancel":"Cancelar","labels.flash.created":"Etiqueta criada com sucesso!","labels.flash.updated":"Etiqueta atualizada com sucesso!","labels.flash.deleted":"Etiqueta excluída com sucesso!","mail.workspace_connections_disconnected.subject":"{1} :count conta precisa ser reconectada em :workspace|[2,*] :count contas precisam ser reconectadas em :workspace","mail.workspace_connections_disconnected.title":"Contas Precisam ser Reconectadas","mail.workspace_connections_disconnected.intro":"As seguintes contas de redes sociais no seu workspace :workspace foram desconectadas e precisam ser reconectadas:","mail.workspace_connections_disconnected.reasons_title":"Isso pode ter acontecido porque:","mail.workspace_connections_disconnected.reason_expired":"Os tokens de acesso expiraram","mail.workspace_connections_disconnected.reason_revoked":"Você revogou o acesso ao TryPost na plataforma","mail.workspace_connections_disconnected.reason_changed":"A plataforma mudou os requisitos de autenticação","mail.workspace_connections_disconnected.reconnect_cta":"Por favor, reconecte essas contas para continuar agendando e publicando posts.","mail.workspace_connections_disconnected.button":"Reconectar Contas","pagination.previous":"« Anterior","pagination.next":"Próximo »","passwords.reset":"Sua senha foi redefinida.","passwords.sent":"Enviamos o link de redefinição de senha por e-mail.","passwords.throttled":"Por favor, aguarde antes de tentar novamente.","passwords.token":"Este token de redefinição de senha é inválido.","passwords.user":"Não conseguimos encontrar um usuário com esse endereço de e-mail.","posts.title":"Posts","posts.all_posts":"Todos os Posts","posts.new_post":"Novo Post","posts.no_posts":"Nenhum post encontrado","posts.start_creating":"Comece criando seu primeiro post.","posts.manage_posts":"Gerencie todos os seus posts","posts.delete_confirm":"Tem certeza que deseja excluir este post?","posts.by":"por","posts.actions.view":"Ver post","posts.actions.delete":"Excluir post","posts.form.post_type":"Tipo de Post","posts.form.board":"Pasta","posts.form.select_board":"Selecione uma pasta","posts.form.search_board":"Buscar pasta...","posts.form.no_board_found":"Nenhuma pasta encontrada","posts.form.media":"Mídia","posts.form.min":"Mín","posts.form.uploading":"Enviando...","posts.form.drop_to_upload":"Solte para enviar","posts.form.drag_and_drop":"Arraste e solte ou clique para enviar","posts.form.photos_and_videos":"Fotos e vídeos","posts.form.photos_only":"Apenas fotos","posts.form.videos_only":"Apenas vídeos","posts.form.drag_to_reorder":"Arraste para reordenar","posts.form.caption":"Legenda","posts.form.write_caption":"Escreva sua legenda...","posts.status.draft":"Rascunho","posts.status.scheduled":"Agendado","posts.status.publishing":"Publicando","posts.status.published":"Publicado","posts.status.partially_published":"Parcialmente Publicado","posts.status.failed":"Falhou","posts.descriptions.draft":"Posts aguardando agendamento","posts.descriptions.scheduled":"Posts agendados para publicação","posts.descriptions.published":"Posts já publicados","posts.edit.title":"Editar Post","posts.edit.view_title":"Visualizar Post","posts.edit.manage_platforms":"Gerenciar plataformas","posts.edit.sync":"Sincronizar","posts.edit.labels":"Etiquetas","posts.edit.hashtags":"Hashtags","posts.edit.schedule":"Agendar","posts.edit.publish":"Publicar","posts.edit.delete":"Excluir","posts.edit.settings":"Configurações","posts.edit.schedule_for":"Agendar para","posts.edit.saving":"Salvando...","posts.edit.saved":"Salvo","posts.edit.scheduled_at":"Agendado:","posts.edit.published_at":"Publicado:","posts.edit.media":"Mídia","posts.edit.caption":"Legenda","posts.edit.no_caption":"Sem legenda","posts.edit.no_content":"Sem conteúdo","posts.edit.empty_state.title":"Nenhuma plataforma selecionada","posts.edit.empty_state.description":"Selecione pelo menos uma plataforma para criar seu post","posts.edit.delete_modal.title":"Excluir Post","posts.edit.delete_modal.description":"Tem certeza que deseja excluir este post? Esta ação não pode ser desfeita.","posts.edit.delete_modal.action":"Excluir","posts.edit.delete_modal.cancel":"Cancelar","posts.edit.sync_enable.title":"Ativar sincronização?","posts.edit.sync_enable.description":"Todas as plataformas compartilharão o mesmo conteúdo. Qualquer edição personalizada feita em plataformas individuais será substituída pelo conteúdo atual.","posts.edit.sync_enable.cancel":"Cancelar","posts.edit.sync_enable.action":"Ativar sincronização","posts.edit.sync_disable.title":"Desativar sincronização?","posts.edit.sync_disable.description":"Cada plataforma manterá seu conteúdo atual, mas edições futuras serão aplicadas apenas à plataforma que você estiver editando.","posts.edit.sync_disable.customize_note":"Você poderá personalizar o conteúdo para cada plataforma individualmente.","posts.edit.sync_disable.cancel":"Cancelar","posts.edit.sync_disable.action":"Desativar sincronização","posts.edit.platforms_dialog.title":"Selecionar Plataformas","posts.edit.platforms_dialog.description":"Escolha em quais plataformas publicar este post.","posts.edit.hashtags_modal.search":"Buscar hashtags...","posts.edit.hashtags_modal.no_results":"Nenhuma hashtag encontrada.","posts.edit.validation.select_board":"Selecione uma pasta","posts.edit.validation.images_not_supported":"Imagens não suportadas","posts.edit.validation.videos_not_supported":"Vídeos não suportados","posts.edit.validation.max_images":"Máx :count imagens","posts.edit.validation.requires_media":"Requer mídia","posts.edit.validation.exceeded":":count excedido","posts.edit.validation.does_not_support_images":":platform não suporta imagens","posts.edit.validation.supports_up_to_images":":platform suporta até :count imagens","posts.edit.validation.does_not_support_videos":":platform não suporta vídeos","posts.content_types.instagram_feed.label":"Post do Feed","posts.content_types.instagram_feed.description":"Aparece no seu feed e perfil","posts.content_types.instagram_reel.label":"Reels","posts.content_types.instagram_reel.description":"Vídeo curto de até 90 segundos","posts.content_types.instagram_story.label":"Story","posts.content_types.instagram_story.description":"Desaparece após 24 horas","posts.content_types.linkedin_post.label":"Post","posts.content_types.linkedin_post.description":"Post padrão com texto e mídia","posts.content_types.linkedin_carousel.label":"Carrossel","posts.content_types.linkedin_carousel.description":"Imagens deslizáveis","posts.content_types.linkedin_page_post.label":"Post","posts.content_types.linkedin_page_post.description":"Post padrão com texto e mídia","posts.content_types.linkedin_page_carousel.label":"Carrossel","posts.content_types.linkedin_page_carousel.description":"Imagens deslizáveis","posts.content_types.facebook_post.label":"Post","posts.content_types.facebook_post.description":"Post padrão na sua página","posts.content_types.facebook_reel.label":"Reels","posts.content_types.facebook_reel.description":"Vídeo curto de até 90 segundos","posts.content_types.facebook_story.label":"Story","posts.content_types.facebook_story.description":"Desaparece após 24 horas","posts.content_types.tiktok_video.label":"Vídeo","posts.content_types.tiktok_video.description":"Conteúdo de vídeo curto","posts.content_types.youtube_short.label":"Short","posts.content_types.youtube_short.description":"Vídeo vertical de até 60 segundos","posts.content_types.x_post.label":"Post","posts.content_types.x_post.description":"Tweet com texto e mídia","posts.content_types.threads_post.label":"Post","posts.content_types.threads_post.description":"Post de texto com mídia opcional","posts.content_types.pinterest_pin.label":"Pin","posts.content_types.pinterest_pin.description":"Pin de imagem com link","posts.content_types.pinterest_video_pin.label":"Pin de Vídeo","posts.content_types.pinterest_video_pin.description":"Conteúdo em vídeo","posts.content_types.pinterest_carousel.label":"Carrossel","posts.content_types.pinterest_carousel.description":"2-5 imagens","posts.content_types.bluesky_post.label":"Post","posts.content_types.bluesky_post.description":"Post de texto com imagens opcionais","posts.content_types.mastodon_post.label":"Post","posts.content_types.mastodon_post.description":"Post de texto com mídia opcional","posts.platforms.linkedin":"LinkedIn","posts.platforms.linkedin-page":"Página do LinkedIn","posts.platforms.x":"X","posts.platforms.tiktok":"TikTok","posts.platforms.youtube":"YouTube Shorts","posts.platforms.facebook":"Página do Facebook","posts.platforms.instagram":"Instagram","posts.platforms.threads":"Threads","posts.platforms.pinterest":"Pinterest","posts.platforms.bluesky":"Bluesky","posts.platforms.mastodon":"Mastodon","posts.flash.scheduled":"Post agendado com sucesso!","posts.flash.publishing":"Post está sendo publicado!","posts.flash.deleted":"Post excluído com sucesso!","posts.flash.cannot_edit_published":"Posts publicados não podem ser editados.","posts.flash.connect_first":"Conecte pelo menos uma rede social antes de criar um post.","posts.errors.account_disconnected":"Conta social está desconectada","settings.title":"Configurações","settings.description":"Gerencie seu perfil e configurações da conta","settings.nav.profile":"Perfil","settings.nav.password":"Senha","settings.nav.workspace":"Workspace","settings.nav.members":"Membros","settings.nav.billing":"Faturamento","settings.profile.title":"Configurações do perfil","settings.profile.photo_heading":"Foto do perfil","settings.profile.photo_description":"Envie uma foto de perfil","settings.profile.heading":"Informações do perfil","settings.profile.description":"Atualize seu nome e endereço de e-mail","settings.profile.avatar":"Avatar","settings.profile.name":"Nome","settings.profile.name_placeholder":"Nome completo","settings.profile.email":"Endereço de e-mail","settings.profile.email_placeholder":"Endereço de e-mail","settings.profile.email_unverified":"Seu endereço de e-mail não foi verificado.","settings.profile.resend_verification":"Clique aqui para reenviar o e-mail de verificação.","settings.profile.verification_sent":"Um novo link de verificação foi enviado para seu endereço de e-mail.","settings.profile.save":"Salvar","settings.password.title":"Configurações de senha","settings.password.heading":"Atualizar senha","settings.password.description":"Certifique-se de que sua conta esteja usando uma senha longa e aleatória para se manter seguro","settings.password.current_password":"Senha atual","settings.password.current_password_placeholder":"Senha atual","settings.password.new_password":"Nova senha","settings.password.new_password_placeholder":"Nova senha","settings.password.confirm_password":"Confirmar senha","settings.password.confirm_password_placeholder":"Confirmar senha","settings.password.save":"Salvar senha","settings.delete_account.heading":"Excluir conta","settings.delete_account.description":"Exclua sua conta e todos os seus recursos","settings.delete_account.warning":"Atenção","settings.delete_account.warning_message":"Por favor, prossiga com cuidado, isso não pode ser desfeito.","settings.delete_account.button":"Excluir conta","settings.delete_account.modal_title":"Tem certeza que deseja excluir sua conta?","settings.delete_account.modal_description":"Uma vez que sua conta for excluída, todos os seus recursos e dados também serão permanentemente excluídos. Por favor, digite sua senha para confirmar que deseja excluir permanentemente sua conta.","settings.delete_account.password":"Senha","settings.delete_account.password_placeholder":"Senha","settings.delete_account.cancel":"Cancelar","settings.delete_account.confirm":"Excluir conta","settings.workspace.title":"Configurações do workspace","settings.workspace.logo_heading":"Logo do workspace","settings.workspace.logo_description":"Envie um logo para o workspace","settings.workspace.heading":"Nome do workspace","settings.workspace.description":"Atualize o nome e fuso horário do workspace","settings.workspace.members_heading":"Membros","settings.workspace.members_description":"Gerencie membros e convites do workspace","settings.workspace.name":"Nome","settings.workspace.name_placeholder":"Meu Workspace","settings.workspace.timezone":"Fuso horário","settings.workspace.save":"Salvar","settings.members.title":"Membros","settings.members.heading":"Membros da equipe","settings.members.description":"Gerencie membros e convites deste workspace","settings.members.cancel":"Cancelar","settings.members.remove":"Remover","settings.members.make_admin":"Tornar administrador","settings.members.make_member":"Tornar membro","settings.members.invite.title":"Convidar Membro","settings.members.invite.description":"Envie um convite por e-mail para adicionar colaboradores","settings.members.invite.email":"E-mail","settings.members.invite.email_placeholder":"colaborador@email.com","settings.members.invite.role":"Função","settings.members.invite.role_placeholder":"Selecione uma função","settings.members.invite.submit":"Enviar Convite","settings.members.pending.title":"Convites Pendentes","settings.members.pending.description":"Convites aguardando aceitação","settings.members.pending.empty":"Nenhum convite pendente","settings.members.list.title":"Membros","settings.members.list.description":"Pessoas com acesso a este workspace","settings.members.list.empty":"Nenhum membro além do proprietário","settings.members.remove_modal.title":"Remover membro","settings.members.remove_modal.description":"Tem certeza que deseja remover este membro do workspace? Ele perderá acesso a todos os recursos do workspace.","settings.members.remove_modal.action":"Remover membro","settings.members.cancel_invite_modal.title":"Cancelar convite","settings.members.cancel_invite_modal.description":"Tem certeza que deseja cancelar este convite?","settings.members.cancel_invite_modal.action":"Cancelar convite","settings.members.roles.owner":"Proprietário","settings.members.roles.admin":"Administrador","settings.members.roles.member":"Membro","settings.members.flash.invite_sent":"Convite enviado com sucesso!","settings.members.flash.invite_deleted":"Convite excluído.","settings.members.flash.member_removed":"Membro removido com sucesso.","settings.members.flash.role_updated":"Função do membro atualizada.","settings.members.flash.wrong_email":"Este convite é para um endereço de e-mail diferente.","settings.members.flash.already_member":"Você já é membro deste workspace.","settings.members.flash.invite_accepted":"Bem-vindo! Você agora é membro do workspace.","settings.members.flash.invite_declined":"Convite recusado.","settings.flash.profile_updated":"Perfil atualizado com sucesso!","settings.flash.language_updated":"Idioma atualizado com sucesso!","settings.flash.password_updated":"Senha atualizada com sucesso!","settings.flash.workspace_updated":"Configurações atualizadas com sucesso!","settings.flash.photo_updated":"Foto atualizada com sucesso!","settings.flash.photo_deleted":"Foto removida com sucesso!","settings.flash.logo_updated":"Logo enviado com sucesso!","settings.flash.logo_deleted":"Logo removido com sucesso!","sidebar.select_workspace":"Selecionar workspace","sidebar.create_workspace":"Criar workspace","sidebar.create_post":"Novo post","sidebar.profile":"Perfil","sidebar.log_out":"Sair","sidebar.workspace":"Workspace: :name","sidebar.workspace_select":"Workspace: Selecionar","sidebar.theme":"Tema: :name","sidebar.theme_light":"Claro","sidebar.theme_dark":"Escuro","sidebar.theme_system":"Sistema","sidebar.language":"Idioma: :name","sidebar.language_select":"Idioma: Selecionar","sidebar.groups.posts":"Posts","sidebar.groups.configuration":"Configurações","sidebar.groups.support":"Suporte","sidebar.posts.calendar":"Calendário","sidebar.posts.all":"Todos","sidebar.posts.scheduled":"Agendados","sidebar.posts.posted":"Publicados","sidebar.posts.drafts":"Rascunhos","sidebar.config.connections":"Conexões","sidebar.config.hashtags":"Hashtags","sidebar.config.labels":"Etiquetas","sidebar.config.settings":"Configurações","sidebar.support.discord":"Discord","sidebar.support.share_feedback":"Enviar feedback","sidebar.support.last_updates":"Últimas Atualizações","sidebar.support.docs":"Documentação","validation.accepted":"O campo :attribute deve ser aceito.","validation.accepted_if":"O campo :attribute deve ser aceito quando :other for :value.","validation.active_url":"O campo :attribute deve ser uma URL válida.","validation.after":"O campo :attribute deve ser uma data posterior a :date.","validation.after_or_equal":"O campo :attribute deve ser uma data posterior ou igual a :date.","validation.alpha":"O campo :attribute deve conter apenas letras.","validation.alpha_dash":"O campo :attribute deve conter apenas letras, números, hifens e underscores.","validation.alpha_num":"O campo :attribute deve conter apenas letras e números.","validation.any_of":"O campo :attribute é inválido.","validation.array":"O campo :attribute deve ser um array.","validation.ascii":"O campo :attribute deve conter apenas caracteres alfanuméricos e símbolos de um byte.","validation.before":"O campo :attribute deve ser uma data anterior a :date.","validation.before_or_equal":"O campo :attribute deve ser uma data anterior ou igual a :date.","validation.between.array":"O campo :attribute deve ter entre :min e :max itens.","validation.between.file":"O campo :attribute deve estar entre :min e :max kilobytes.","validation.between.numeric":"O campo :attribute deve estar entre :min e :max.","validation.between.string":"O campo :attribute deve estar entre :min e :max caracteres.","validation.boolean":"O campo :attribute deve ser verdadeiro ou falso.","validation.can":"O campo :attribute contém um valor não autorizado.","validation.confirmed":"A confirmação do campo :attribute não corresponde.","validation.contains":"O campo :attribute está faltando um valor obrigatório.","validation.current_password":"A senha está incorreta.","validation.date":"O campo :attribute deve ser uma data válida.","validation.date_equals":"O campo :attribute deve ser uma data igual a :date.","validation.date_format":"O campo :attribute deve corresponder ao formato :format.","validation.decimal":"O campo :attribute deve ter :decimal casas decimais.","validation.declined":"O campo :attribute deve ser recusado.","validation.declined_if":"O campo :attribute deve ser recusado quando :other for :value.","validation.different":"O campo :attribute e :other devem ser diferentes.","validation.digits":"O campo :attribute deve ter :digits dígitos.","validation.digits_between":"O campo :attribute deve ter entre :min e :max dígitos.","validation.dimensions":"O campo :attribute deve ter dimensões de imagem válidas.","validation.distinct":"O campo :attribute tem um valor duplicado.","validation.doesnt_contain":"O campo :attribute não deve conter nenhum dos seguintes: :values.","validation.doesnt_end_with":"O campo :attribute não deve terminar com nenhum dos seguintes: :values.","validation.doesnt_start_with":"O campo :attribute não deve começar com nenhum dos seguintes: :values.","validation.email":"O campo :attribute deve ser um endereço de e-mail válido.","validation.encoding":"O campo :attribute deve ser codificado em :encoding.","validation.ends_with":"O campo :attribute deve terminar com um dos seguintes: :values.","validation.enum":"O :attribute selecionado é inválido.","validation.exists":"O :attribute selecionado é inválido.","validation.extensions":"O campo :attribute deve ter uma das seguintes extensões: :values.","validation.file":"O campo :attribute deve ser um arquivo.","validation.filled":"O campo :attribute deve ter um valor.","validation.gt.array":"O campo :attribute deve ter mais de :value itens.","validation.gt.file":"O campo :attribute deve ser maior que :value kilobytes.","validation.gt.numeric":"O campo :attribute deve ser maior que :value.","validation.gt.string":"O campo :attribute deve ser maior que :value caracteres.","validation.gte.array":"O campo :attribute deve ter :value itens ou mais.","validation.gte.file":"O campo :attribute deve ser maior ou igual a :value kilobytes.","validation.gte.numeric":"O campo :attribute deve ser maior ou igual a :value.","validation.gte.string":"O campo :attribute deve ser maior ou igual a :value caracteres.","validation.hex_color":"O campo :attribute deve ser uma cor hexadecimal válida.","validation.image":"O campo :attribute deve ser uma imagem.","validation.in":"O :attribute selecionado é inválido.","validation.in_array":"O campo :attribute deve existir em :other.","validation.in_array_keys":"O campo :attribute deve conter pelo menos uma das seguintes chaves: :values.","validation.integer":"O campo :attribute deve ser um inteiro.","validation.ip":"O campo :attribute deve ser um endereço IP válido.","validation.ipv4":"O campo :attribute deve ser um endereço IPv4 válido.","validation.ipv6":"O campo :attribute deve ser um endereço IPv6 válido.","validation.json":"O campo :attribute deve ser uma string JSON válida.","validation.list":"O campo :attribute deve ser uma lista.","validation.lowercase":"O campo :attribute deve estar em minúsculas.","validation.lt.array":"O campo :attribute deve ter menos de :value itens.","validation.lt.file":"O campo :attribute deve ser menor que :value kilobytes.","validation.lt.numeric":"O campo :attribute deve ser menor que :value.","validation.lt.string":"O campo :attribute deve ser menor que :value caracteres.","validation.lte.array":"O campo :attribute deve ter :value itens ou menos.","validation.lte.file":"O campo :attribute deve ser menor ou igual a :value kilobytes.","validation.lte.numeric":"O campo :attribute deve ser menor ou igual a :value.","validation.lte.string":"O campo :attribute deve ser menor ou igual a :value caracteres.","validation.mac_address":"O campo :attribute deve ser um endereço MAC válido.","validation.max.array":"O campo :attribute deve ter no máximo :max itens.","validation.max.file":"O campo :attribute deve ter no máximo :max kilobytes.","validation.max.numeric":"O campo :attribute deve ter no máximo :max.","validation.max.string":"O campo :attribute deve ter no máximo :max caracteres.","validation.max_digits":"O campo :attribute não deve ter mais que :max dígitos.","validation.mimes":"O campo :attribute deve ser um arquivo do tipo: :values.","validation.mimetypes":"O campo :attribute deve ser um arquivo do tipo: :values.","validation.min.array":"O campo :attribute deve ter pelo menos :min itens.","validation.min.file":"O campo :attribute deve ter pelo menos :min kilobytes.","validation.min.numeric":"O campo :attribute deve ter pelo menos :min.","validation.min.string":"O campo :attribute deve ter pelo menos :min caracteres.","validation.min_digits":"O campo :attribute deve ter pelo menos :min dígitos.","validation.missing":"O campo :attribute deve estar ausente.","validation.missing_if":"O campo :attribute deve estar ausente quando :other for :value.","validation.missing_unless":"O campo :attribute deve estar ausente a menos que :other seja :value.","validation.missing_with":"O campo :attribute deve estar ausente quando :values estiver presente.","validation.missing_with_all":"O campo :attribute deve estar ausente quando :values estiverem presentes.","validation.multiple_of":"O campo :attribute deve ser um múltiplo de :value.","validation.not_in":"O :attribute selecionado é inválido.","validation.not_regex":"O formato do campo :attribute é inválido.","validation.numeric":"O campo :attribute deve ser um número.","validation.password.letters":"O campo :attribute deve conter pelo menos uma letra.","validation.password.mixed":"O campo :attribute deve conter pelo menos uma letra maiúscula e uma minúscula.","validation.password.numbers":"O campo :attribute deve conter pelo menos um número.","validation.password.symbols":"O campo :attribute deve conter pelo menos um símbolo.","validation.password.uncompromised":"O :attribute fornecido apareceu em um vazamento de dados. Por favor, escolha um :attribute diferente.","validation.present":"O campo :attribute deve estar presente.","validation.present_if":"O campo :attribute deve estar presente quando :other for :value.","validation.present_unless":"O campo :attribute deve estar presente a menos que :other seja :value.","validation.present_with":"O campo :attribute deve estar presente quando :values estiver presente.","validation.present_with_all":"O campo :attribute deve estar presente quando :values estiverem presentes.","validation.prohibited":"O campo :attribute é proibido.","validation.prohibited_if":"O campo :attribute é proibido quando :other for :value.","validation.prohibited_if_accepted":"O campo :attribute é proibido quando :other for aceito.","validation.prohibited_if_declined":"O campo :attribute é proibido quando :other for recusado.","validation.prohibited_unless":"O campo :attribute é proibido a menos que :other esteja em :values.","validation.prohibits":"O campo :attribute proíbe :other de estar presente.","validation.regex":"O formato do campo :attribute é inválido.","validation.required":"O campo :attribute é obrigatório.","validation.required_array_keys":"O campo :attribute deve conter entradas para: :values.","validation.required_if":"O campo :attribute é obrigatório quando :other for :value.","validation.required_if_accepted":"O campo :attribute é obrigatório quando :other for aceito.","validation.required_if_declined":"O campo :attribute é obrigatório quando :other for recusado.","validation.required_unless":"O campo :attribute é obrigatório a menos que :other esteja em :values.","validation.required_with":"O campo :attribute é obrigatório quando :values estiver presente.","validation.required_with_all":"O campo :attribute é obrigatório quando :values estiverem presentes.","validation.required_without":"O campo :attribute é obrigatório quando :values não estiver presente.","validation.required_without_all":"O campo :attribute é obrigatório quando nenhum dos :values estiver presente.","validation.same":"O campo :attribute deve ser igual a :other.","validation.size.array":"O campo :attribute deve conter :size itens.","validation.size.file":"O campo :attribute deve ter :size kilobytes.","validation.size.numeric":"O campo :attribute deve ser :size.","validation.size.string":"O campo :attribute deve ter :size caracteres.","validation.starts_with":"O campo :attribute deve começar com um dos seguintes: :values.","validation.string":"O campo :attribute deve ser uma string.","validation.timezone":"O campo :attribute deve ser um fuso horário válido.","validation.unique":"O :attribute já foi utilizado.","validation.uploaded":"O :attribute falhou ao ser enviado.","validation.uppercase":"O campo :attribute deve estar em maiúsculo.","validation.url":"O campo :attribute deve ser uma URL válida.","validation.ulid":"O campo :attribute deve ser um ULID válido.","validation.uuid":"O campo :attribute deve ser um UUID válido.","validation.custom.attribute-name.rule-name":"custom-message"} \ No newline at end of file diff --git a/lang/pt-br/auth.php b/lang/pt-br/auth.php index 1333a3a5..b04e5b7b 100644 --- a/lang/pt-br/auth.php +++ b/lang/pt-br/auth.php @@ -22,6 +22,35 @@ 'welcome_trial' => 'Bem-vindo ao TryPost! Seu período de teste começou.', ], + 'legal' => 'Ao continuar, você concorda com nossos Termos de Serviço e Política de Privacidade.', + + 'slides' => [ + 'calendar' => [ + 'title' => 'Calendário Visual', + 'description' => 'Planeje e agende seu conteúdo com um calendário intuitivo de arrastar e soltar em todas as suas contas sociais.', + ], + 'scheduling' => [ + 'title' => 'Agendamento Inteligente', + 'description' => 'Agende posts no LinkedIn, X, Instagram, TikTok, YouTube e mais — tudo em um só lugar.', + ], + 'media' => [ + 'title' => 'Mídia Rica', + 'description' => 'Publique imagens, carrosséis, stories e reels. Cada plataforma recebe o formato correto automaticamente.', + ], + 'video' => [ + 'title' => 'Publicação de Vídeo', + 'description' => 'Envie vídeos uma vez e publique no TikTok, YouTube Shorts, Instagram Reels e Facebook Reels.', + ], + 'team' => [ + 'title' => 'Workspaces em Equipe', + 'description' => 'Convide sua equipe, atribua funções e gerencie múltiplas marcas em workspaces separados.', + ], + 'hashtags' => [ + 'title' => 'Grupos de Hashtags', + 'description' => 'Salve coleções de hashtags e adicione aos posts com um clique. Organize com etiquetas e filtros.', + ], + ], + 'login' => [ 'title' => 'Entrar na sua conta', 'description' => 'Digite seu email e senha abaixo para entrar', @@ -43,6 +72,8 @@ 'name_placeholder' => 'Nome completo', 'email' => 'Endereço de email', 'password' => 'Senha', + 'show_password' => 'Mostrar senha', + 'hide_password' => 'Esconder senha', 'submit' => 'Criar conta', 'has_account' => 'Já tem uma conta?', 'log_in' => 'Entrar', diff --git a/lang/pt-br/billing.php b/lang/pt-br/billing.php index 943b13f9..ebef44dc 100644 --- a/lang/pt-br/billing.php +++ b/lang/pt-br/billing.php @@ -4,6 +4,23 @@ 'title' => 'Assinatura', 'description' => 'Gerencie sua assinatura e método de pagamento', + 'subscribe' => [ + 'page_title' => 'Comece seu teste gratuito', + 'title' => 'Comece seu teste gratuito', + 'description' => ':days dias grátis. Sem cartão de crédito para começar.', + 'start_trial' => 'Começar teste de :days dias', + 'cancel_anytime' => 'Cancele a qualquer momento. Sem perguntas.', + 'switch_workspace' => 'Trocar workspace', + 'features' => [ + 'calendar' => 'Calendário visual com arrastar e soltar', + 'scheduling' => 'Agendamento ilimitado de posts', + 'media' => 'Imagens, carrosséis e stories', + 'video' => 'Publicação de vídeos em todas as plataformas', + 'team' => 'Colaboração em equipe e workspaces', + 'hashtags' => 'Grupos de hashtags e etiquetas', + ], + ], + 'trial' => [ 'title' => 'Período de teste ativo', 'description' => 'Seu período de teste termina em :date. Após isso, sua assinatura será cobrada automaticamente.', diff --git a/lang/pt-br/common.php b/lang/pt-br/common.php new file mode 100644 index 00000000..7efd7966 --- /dev/null +++ b/lang/pt-br/common.php @@ -0,0 +1,12 @@ + [ + 'cannot_be_undone' => 'Esta ação não pode ser desfeita.', + 'type' => 'Digite', + 'to_confirm' => 'para confirmar.', + 'copy_to_clipboard' => 'Copiar para a área de transferência', + ], +]; diff --git a/lang/pt-br/settings.php b/lang/pt-br/settings.php index 51ed7e98..44233b07 100644 --- a/lang/pt-br/settings.php +++ b/lang/pt-br/settings.php @@ -77,6 +77,8 @@ 'cancel' => 'Cancelar', 'remove' => 'Remover', + 'make_admin' => 'Tornar administrador', + 'make_member' => 'Tornar membro', 'invite' => [ 'title' => 'Convidar Membro', @@ -122,6 +124,7 @@ 'invite_sent' => 'Convite enviado com sucesso!', 'invite_deleted' => 'Convite excluído.', 'member_removed' => 'Membro removido com sucesso.', + 'role_updated' => 'Função do membro atualizada.', 'wrong_email' => 'Este convite é para um endereço de e-mail diferente.', 'already_member' => 'Você já é membro deste workspace.', 'invite_accepted' => 'Bem-vindo! Você agora é membro do workspace.', diff --git a/maizzle/components/header.html b/maizzle/components/header.html index 7803f18d..894443cd 100644 --- a/maizzle/components/header.html +++ b/maizzle/components/header.html @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vue index 6b413c3f..58c102c7 100644 --- a/resources/js/components/AppSidebar.vue +++ b/resources/js/components/AppSidebar.vue @@ -2,7 +2,6 @@ import { Link, router, usePage } from '@inertiajs/vue3'; import { IconAffiliate, - IconBook, IconBrandDiscord, IconCalendar, IconChevronRight, @@ -10,7 +9,6 @@ import { IconFileCheck, IconFileText, IconHash, - IconKey, IconLifebuoy, IconMessageCircle, IconPencil, @@ -46,7 +44,6 @@ import { useSidebar, } from '@/components/ui/sidebar'; import { accounts, calendar } from '@/routes/app'; -import { index as apiKeysIndex } from '@/routes/app/api-keys'; import { index as hashtags } from '@/routes/app/hashtags'; import { index as labels } from '@/routes/app/labels'; import { edit as editProfile } from '@/routes/app/profile'; @@ -77,6 +74,7 @@ const postsNavItems = computed(() => [ title: trans('sidebar.posts.all'), href: postsIndex.url(), icon: IconFileText, + exact: true, }, { title: trans('sidebar.posts.scheduled'), @@ -114,11 +112,6 @@ const configNavItems = computed(() => { href: labels.url(), icon: IconTag, }, - { - title: 'API Keys', - href: apiKeysIndex.url(), - icon: IconKey, - }, ]; if (canManageWorkspace.value) { @@ -147,16 +140,11 @@ const switchWorkspace = (workspaceId: string) => { - - + + fallback-class="bg-sidebar-accent text-sidebar-accent-foreground" />
{{ currentWorkspace?.name ?? $t('sidebar.select_workspace') }} @@ -165,29 +153,17 @@ const switchWorkspace = (workspaceId: string) => { - + {{ $t('sidebar.workspaces') }}
- - + @click="switchWorkspace(workspace.id)"> + {{ workspace.name }}
@@ -231,7 +207,8 @@ const switchWorkspace = (workspaceId: string) => { - + {{ $t('sidebar.support.share_feedback') }} @@ -239,7 +216,7 @@ const switchWorkspace = (workspaceId: string) => { - + {{ $t('sidebar.support.docs') }} @@ -249,4 +226,4 @@ const switchWorkspace = (workspaceId: string) => { - + \ No newline at end of file diff --git a/resources/js/components/ConfirmDeleteModal.vue b/resources/js/components/ConfirmDeleteModal.vue index 3913cf15..a68a1c5b 100644 --- a/resources/js/components/ConfirmDeleteModal.vue +++ b/resources/js/components/ConfirmDeleteModal.vue @@ -1,135 +1,197 @@ \ No newline at end of file + + + + + {{ title }} + + {{ description }} + + {{ trans('common.confirm_modal.cannot_be_undone') }} + + + +
+

+ {{ trans('common.confirm_modal.type') }} + + {{ confirmText }} + + + + + + +

{{ trans('common.confirm_modal.copy_to_clipboard') }}

+ + + + + {{ trans('common.confirm_modal.to_confirm') }} +

+ +
+ + + + +
+
+ diff --git a/resources/js/components/EmptyState.vue b/resources/js/components/EmptyState.vue new file mode 100644 index 00000000..43844b40 --- /dev/null +++ b/resources/js/components/EmptyState.vue @@ -0,0 +1,19 @@ + + + diff --git a/resources/js/components/NavMain.vue b/resources/js/components/NavMain.vue index 0eefa85a..6a0db57f 100644 --- a/resources/js/components/NavMain.vue +++ b/resources/js/components/NavMain.vue @@ -28,7 +28,7 @@ const { urlIsActive } = useActiveUrl(); diff --git a/resources/js/components/UserMenuContent.vue b/resources/js/components/UserMenuContent.vue index f95e676f..cf0812bc 100644 --- a/resources/js/components/UserMenuContent.vue +++ b/resources/js/components/UserMenuContent.vue @@ -42,7 +42,7 @@ defineProps(); const page = usePage(); const languages = computed(() => page.props.languages as Language[]); -const currentLanguage = computed(() => languages.value?.find((l: Language) => l.code === page.props.auth.user?.locale)); +const currentLanguage = computed(() => languages.value?.find((l: Language) => l.code === page.props.locale)); const { appearance, updateAppearance } = useAppearance(); diff --git a/resources/js/components/api-keys/CreateApiKeyDialog.vue b/resources/js/components/api-keys/CreateApiKeyDialog.vue new file mode 100644 index 00000000..e696fd79 --- /dev/null +++ b/resources/js/components/api-keys/CreateApiKeyDialog.vue @@ -0,0 +1,76 @@ + + + diff --git a/resources/js/components/members/InviteMemberDialog.vue b/resources/js/components/members/InviteMemberDialog.vue new file mode 100644 index 00000000..0302de7d --- /dev/null +++ b/resources/js/components/members/InviteMemberDialog.vue @@ -0,0 +1,93 @@ + + + diff --git a/resources/js/components/ui/dialog/DialogFooter.vue b/resources/js/components/ui/dialog/DialogFooter.vue index 0a936e61..2d42c35b 100644 --- a/resources/js/components/ui/dialog/DialogFooter.vue +++ b/resources/js/components/ui/dialog/DialogFooter.vue @@ -8,7 +8,7 @@ const props = defineProps<{ class?: HTMLAttributes["class"] }>() @@ -86,12 +87,12 @@ function retry() {
-

Checkout cancelled

+

{{ $t('billing.processing.cancelled_title') }}

- Your checkout was cancelled. No charges were made. + {{ $t('billing.processing.cancelled_description') }}

diff --git a/resources/js/pages/onboarding/Step1.vue b/resources/js/pages/onboarding/Step1.vue index 77b95722..bd13f00a 100644 --- a/resources/js/pages/onboarding/Step1.vue +++ b/resources/js/pages/onboarding/Step1.vue @@ -1,6 +1,7 @@ diff --git a/resources/js/pages/onboarding/Step2.vue b/resources/js/pages/onboarding/Step2.vue index 718aba6e..92ea2d71 100644 --- a/resources/js/pages/onboarding/Step2.vue +++ b/resources/js/pages/onboarding/Step2.vue @@ -83,11 +83,11 @@ const submit = () => {