diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php
index fe3ea727..7cb80ccf 100644
--- a/app/Http/Controllers/PostController.php
+++ b/app/Http/Controllers/PostController.php
@@ -30,7 +30,7 @@ public function index(Request $request, ?string $status = null): Response|Redire
$query = $workspace->posts()
->with(['postPlatforms' => function ($query) {
$query->where('enabled', true)->with('socialAccount');
- }, 'user']);
+ }, 'user', 'labels']);
// Apply status filter if provided
if ($status) {
@@ -97,7 +97,7 @@ public function calendar(Request $request): Response|RedirectResponse
]);
}
- public function store(Request $request): RedirectResponse
+ public function store(Request $request): RedirectResponse|\Symfony\Component\HttpFoundation\Response
{
$workspace = $request->user()->currentWorkspace;
@@ -141,7 +141,7 @@ public function store(Request $request): RedirectResponse
]);
}
- return redirect()->route('posts.edit', $post);
+ return Inertia::location(route('posts.edit', $post));
}
public function edit(Request $request, Post $post): Response|RedirectResponse
@@ -158,8 +158,10 @@ public function edit(Request $request, Post $post): Response|RedirectResponse
abort(404);
}
- $post->load(['postPlatforms.socialAccount', 'postPlatforms.media']);
+ $post->load(['postPlatforms.socialAccount', 'postPlatforms.media', 'labels']);
$socialAccounts = $workspace->socialAccounts;
+ $labels = $workspace->labels;
+ $hashtags = $workspace->hashtags;
$platformConfigs = $socialAccounts->mapWithKeys(function ($account) {
$platform = $account->platform;
@@ -191,6 +193,8 @@ public function edit(Request $request, Post $post): Response|RedirectResponse
'socialAccounts' => $socialAccounts,
'platformConfigs' => $platformConfigs,
'pinterestBoards' => $pinterestBoards,
+ 'labels' => $labels,
+ 'hashtags' => $hashtags,
]);
}
@@ -228,6 +232,11 @@ public function update(UpdatePostRequest $request, Post $post): RedirectResponse
'scheduled_at' => $scheduledAt,
]);
+ // Sync labels
+ if ($request->has('label_ids')) {
+ $post->labels()->sync($request->input('label_ids', []));
+ }
+
// Get selected platform IDs
$selectedPlatformIds = collect($request->input('platforms', []))->pluck('id')->toArray();
diff --git a/app/Http/Requests/UpdatePostRequest.php b/app/Http/Requests/UpdatePostRequest.php
index 65618e92..af0278f3 100644
--- a/app/Http/Requests/UpdatePostRequest.php
+++ b/app/Http/Requests/UpdatePostRequest.php
@@ -19,6 +19,8 @@ public function rules(): array
'platforms' => ['sometimes', 'array'],
'platforms.*.id' => ['required', 'uuid', 'exists:post_platforms,id'],
'platforms.*.content' => ['nullable', 'string', 'max:5000'],
+ 'label_ids' => ['sometimes', 'array'],
+ 'label_ids.*' => ['uuid', 'exists:workspace_labels,id'],
];
}
diff --git a/app/Models/Post.php b/app/Models/Post.php
index d7a9fac8..bcf89158 100644
--- a/app/Models/Post.php
+++ b/app/Models/Post.php
@@ -8,6 +8,7 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Post extends Model
@@ -49,6 +50,11 @@ public function postPlatforms(): HasMany
return $this->hasMany(PostPlatform::class);
}
+ public function labels(): BelongsToMany
+ {
+ return $this->belongsToMany(WorkspaceLabel::class);
+ }
+
public function scopeScheduled(Builder $query): Builder
{
return $query->where('status', PostStatus::Scheduled);
diff --git a/app/Models/WorkspaceLabel.php b/app/Models/WorkspaceLabel.php
index 20f1323a..1a74ea88 100644
--- a/app/Models/WorkspaceLabel.php
+++ b/app/Models/WorkspaceLabel.php
@@ -6,6 +6,7 @@
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class WorkspaceLabel extends Model
@@ -23,4 +24,9 @@ public function workspace(): BelongsTo
{
return $this->belongsTo(Workspace::class);
}
+
+ public function posts(): BelongsToMany
+ {
+ return $this->belongsToMany(Post::class);
+ }
}
diff --git a/database/migrations/2026_01_26_173538_create_post_workspace_label_table.php b/database/migrations/2026_01_26_173538_create_post_workspace_label_table.php
new file mode 100644
index 00000000..23c43293
--- /dev/null
+++ b/database/migrations/2026_01_26_173538_create_post_workspace_label_table.php
@@ -0,0 +1,28 @@
+foreignUuid('post_id')->constrained()->cascadeOnDelete();
+ $table->foreignUuid('workspace_label_id')->constrained()->cascadeOnDelete();
+ $table->primary(['post_id', 'workspace_label_id']);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('post_workspace_label');
+ }
+};
diff --git a/lang/en/posts.php b/lang/en/posts.php
index 6eafe3cd..98c5880a 100644
--- a/lang/en/posts.php
+++ b/lang/en/posts.php
@@ -56,6 +56,7 @@
'view_title' => 'View Post',
'manage_platforms' => 'Manage platforms',
'sync' => 'Sync',
+ 'labels' => 'Labels',
'schedule' => 'Schedule',
'publish' => 'Publish',
'saving' => 'Saving...',
@@ -99,6 +100,11 @@
'description' => 'Choose which platforms to publish this post to.',
],
+ 'hashtags_modal' => [
+ 'search' => 'Search hashtags...',
+ 'no_results' => 'No hashtags found.',
+ ],
+
'validation' => [
'select_board' => 'Select a board',
'images_not_supported' => 'Images not supported',
diff --git a/lang/pt-br/posts.php b/lang/pt-br/posts.php
index a35988e5..d2f4214f 100644
--- a/lang/pt-br/posts.php
+++ b/lang/pt-br/posts.php
@@ -56,6 +56,7 @@
'view_title' => 'Visualizar Post',
'manage_platforms' => 'Gerenciar plataformas',
'sync' => 'Sincronizar',
+ 'labels' => 'Etiquetas',
'schedule' => 'Agendar',
'publish' => 'Publicar',
'saving' => 'Salvando...',
@@ -99,6 +100,11 @@
'description' => 'Escolha em quais plataformas publicar este post.',
],
+ 'hashtags_modal' => [
+ 'search' => 'Buscar hashtags...',
+ 'no_results' => 'Nenhuma hashtag encontrada.',
+ ],
+
'validation' => [
'select_board' => 'Selecione uma pasta',
'images_not_supported' => 'Imagens não suportadas',
diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vue
index 8e831a66..1ca17e10 100644
--- a/resources/js/components/AppSidebar.vue
+++ b/resources/js/components/AppSidebar.vue
@@ -194,6 +194,10 @@ function createWorkspace() {
}
function isActive(href: string): boolean {
+ // For /posts, also match /posts/{id}/edit
+ if (href === '/posts') {
+ return page.url === '/posts' || page.url.startsWith('/posts/') && page.url.includes('/edit');
+ }
// Exact match or match with query string
return page.url === href || page.url.startsWith(href + '?');
}
diff --git a/resources/js/components/SocialAccountsGrid.vue b/resources/js/components/SocialAccountsGrid.vue
index 068e1c7a..7c8ebf71 100644
--- a/resources/js/components/SocialAccountsGrid.vue
+++ b/resources/js/components/SocialAccountsGrid.vue
@@ -183,7 +183,7 @@ const isDisconnected = (account: SocialAccount | null): boolean => {
-
+
{{ platform.account.display_name?.charAt(0) }}
diff --git a/resources/js/components/posts/HashtagsModal.vue b/resources/js/components/posts/HashtagsModal.vue
new file mode 100644
index 00000000..51f3a4c9
--- /dev/null
+++ b/resources/js/components/posts/HashtagsModal.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+ {{ $t('posts.edit.hashtags_modal.no_results') }}
+
+
+
+
+ {{ hashtag.name }}
+
+
+ {{ hashtag.hashtags }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/js/components/ui/command/CommandDialog.vue b/resources/js/components/ui/command/CommandDialog.vue
index 74397360..a60d135f 100644
--- a/resources/js/components/ui/command/CommandDialog.vue
+++ b/resources/js/components/ui/command/CommandDialog.vue
@@ -7,9 +7,11 @@ import Command from "./Command.vue"
const props = withDefaults(defineProps(), {
title: "Command Palette",
description: "Search for a command to run...",
+ showCloseButton: false,
})
const emits = defineEmits()
@@ -18,7 +20,7 @@ const forwarded = useForwardPropsEmits(props, emits)