### Initialize a new Maizzle project Source: https://github.com/trypost-it/trypost/blob/main/maizzle/README.md Run this command in your terminal to start the project setup wizard. ```bash npx create-maizzle ``` -------------------------------- ### Basic Pest Test Example Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md A simple test case using the Pest testing framework. ```php it('is true', function () { expect(true)->toBeTrue(); }); ``` -------------------------------- ### Pest Dataset Example Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Uses a dataset to run the same test logic against multiple input values. ```php it('has emails', function (string $email) { expect($email)->not->toBeEmpty(); })->with([ 'james' => 'james@laravel.com', 'taylor' => 'taylor@laravel.com', ]); ``` -------------------------------- ### Initialize TryPost Project Source: https://github.com/trypost-it/trypost/blob/main/README.md Standard commands to clone the repository, install dependencies, and prepare the environment for local development. ```bash git clone https://github.com/trypost-it/trypost.git cd trypost cp .env.example .env composer install npm install php artisan key:generate php artisan migrate npm run build ``` -------------------------------- ### Pest Browser and Smoke Testing Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Examples for performing browser-based interactions and smoke testing across multiple routes. ```php it('may reset the password', function () { Notification::fake(); $this->actingAs(User::factory()->create()); $page = visit('/sign-in'); // Visit on a real browser... $page->assertSee('Sign In') ->assertNoJavascriptErrors() // or ->assertNoConsoleLogs() ->click('Forgot Password?') ->fill('email', 'nuno@laravel.com') ->click('Send Reset Link') ->assertSee('We have emailed your password reset link!') Notification::assertSent(ResetPassword::class); }); ``` ```php $pages = visit(['/', '/about', '/contact']); $pages->assertNoJavascriptErrors()->assertNoConsoleLogs(); ``` -------------------------------- ### Tailwind CSS v4 Configuration and Imports Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Examples for extending themes and importing Tailwind in version 4. ```css @theme { --color-brand: oklch(0.72 0.11 178); } ``` ```diff - @tailwind base; - @tailwind components; - @tailwind utilities; + @import "tailwindcss"; ``` -------------------------------- ### Inertia Render Example in Laravel Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Use Inertia::render() for server-side routing in Laravel applications instead of traditional Blade views. This example demonstrates rendering the 'Users/Index' Inertia component with user data. ```php // routes/web.php example Route::get('/users', function () { return Inertia::render('Users/Index', [ 'users' => User::all() ]); }); ``` -------------------------------- ### Pest Example Asserting postJson Response Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Demonstrates how to perform a JSON POST request and assert a successful response. ```php it('returns all', function () { $response = $this->postJson('/api/docs', []); $response->assertSuccessful(); }); ``` -------------------------------- ### Get Workspace Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves the current workspace details associated with the API token. ```APIDOC ## GET /api/workspace ### Description Retrieves the current workspace details associated with the API token. ### Method GET ### Endpoint /api/workspace ### Response #### Success Response (200 OK) - **data** (object) - Contains the workspace details. - **id** (string) - The unique identifier of the workspace. - **name** (string) - The name of the workspace. - **timezone** (string) - The timezone configured for the workspace. - **created_at** (string) - The timestamp when the workspace was created. - **updated_at** (string) - The timestamp when the workspace was last updated. ### Response Example ```json { "data": { "id": "aa0e8400-e29b-41d4-a716-446655440005", "name": "My Brand", "timezone": "America/New_York", "created_at": "2024-01-01 00:00:00", "updated_at": "2024-12-01 12:00:00" } } ``` ``` -------------------------------- ### Get Workspace API Request Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves details about the current workspace linked to the provided API token. ```bash curl -X GET "https://your-domain.com/api/workspace" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" ``` -------------------------------- ### GET /api/posts Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves a paginated list of all posts for the current workspace, sorted by scheduled date. ```APIDOC ## GET /api/posts ### Description Retrieves all posts for the current workspace with their platform content, status, labels, and scheduled dates. Results are paginated with 15 items per page and sorted by scheduled date (newest first). ### Method GET ### Endpoint /api/posts ### Response #### Success Response (200) - **data** (array) - List of post objects - **links** (object) - Pagination links - **meta** (object) - Pagination metadata #### Response Example { "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "status": "scheduled", "scheduled_at": "2024-12-20 09:00:00" } ] } ``` -------------------------------- ### GET /api/posts/{id} Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves details for a specific post by its unique identifier. ```APIDOC ## GET /api/posts/{id} ### Description Retrieves a specific post by ID with all platform content, social account details, and labels. ### Method GET ### Endpoint /api/posts/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the post ### Response #### Success Response (200) - **data** (object) - The post object #### Response Example { "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "status": "draft" } } ``` -------------------------------- ### PHP Explicit Return Types and Method Parameters Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Always declare explicit return types for methods and functions, and use appropriate PHP type hints for method parameters. This example shows a protected method with a User object and an optional string path, returning a boolean. ```php protected function isAccessible(User $user, ?string $path = null): bool { ... } ``` -------------------------------- ### List API Keys Source: https://context7.com/trypost-it/trypost/llms.txt Lists all API keys for the workspace, returning only key hints for security. ```bash curl -X GET "https://your-domain.com/api/api-keys" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" ``` -------------------------------- ### Dusk Browser Testing Patterns Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Best practices for interacting with elements and navigating routes in Dusk tests. ```php $browser->visit(route('login')) ``` ```php $browser->waitFor('@input-error') ``` -------------------------------- ### Configure TryPost MCP Server Source: https://context7.com/trypost-it/trypost/llms.txt Add this configuration to your AI assistant's MCP settings to enable communication with the TryPost server. ```json { "mcpServers": { "trypost": { "url": "https://your-domain.com/mcp/trypost", "transport": "http", "headers": { "Authorization": "Bearer tp_your_api_key_here" } } } } ``` -------------------------------- ### Format PHP Code with Pint Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Command to fix code style issues using Laravel Pint. ```bash vendor/bin/pint --format agent ``` -------------------------------- ### Wayfinder Basic Usage Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Demonstrates importing controller methods and generating route URLs or objects in TypeScript. ```typescript // Import controller methods (tree-shakable...) import { show, store, update } from '@/actions/App/Http/Controllers/PostController' // Get route object with URL and method... show(1) // { url: "/posts/1", method: "get" } // Get just the URL... show.url(1) // "/posts/1" // Use specific HTTP methods... show.get(1) // { url: "/posts/1", method: "get" } show.head(1) // { url: "/posts/1", method: "head" } // Import named routes... import { show as postShow } from '@/routes/post' // For route name 'post.show' postShow(1) // { url: "/posts/1", method: "get" } ``` -------------------------------- ### Create New Post Source: https://context7.com/trypost-it/trypost/llms.txt Creates a post with platform-specific content. Requires a social account ID and content type for each platform entry. ```bash curl -X POST "https://your-domain.com/api/posts" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "platforms": [ { "social_account_id": "770e8400-e29b-41d4-a716-446655440002", "content_type": "x_post", "content": "Excited to announce our new feature! #launch #tech" }, { "social_account_id": "770e8400-e29b-41d4-a716-446655440003", "content_type": "linkedin_post", "content": "We are thrilled to announce our latest feature that will help teams collaborate more effectively." } ], "scheduled_at": "2024-12-25T14:00:00Z", "status": "scheduled" }' # Response (201 Created) # { # "data": { # "id": "990e8400-e29b-41d4-a716-446655440004", # "status": "scheduled", # "synced": true, # "scheduled_at": "2024-12-25 14:00:00", # "published_at": null, # "platforms": [...] ``` -------------------------------- ### Create Label Source: https://context7.com/trypost-it/trypost/llms.txt Adds a new label. The color field must be a valid hex code in #RRGGBB format. ```bash curl -X POST "https://your-domain.com/api/labels" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Announcements", "color": "#9B59B6" }' ``` -------------------------------- ### Resolve Vite Manifest Errors Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Commands to rebuild assets when the Vite manifest file is missing. ```bash npm run build ``` ```bash npm run dev ``` ```bash composer run dev ``` -------------------------------- ### Create API Key Source: https://context7.com/trypost-it/trypost/llms.txt Generates a new API key. The full token is returned only once and must be stored securely. ```bash curl -X POST "https://your-domain.com/api/api-keys" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "CI/CD Pipeline Key", "expires_at": "2025-06-01" }' ``` -------------------------------- ### PHP Constructor Property Promotion Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Utilize PHP 8 constructor property promotion for cleaner class definitions. ```php public function __construct(public GitHub $github) { } ``` -------------------------------- ### Generate Tests via Artisan Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Create feature or unit tests using the artisan command line interface. ```bash php artisan make:test [options] {name} ``` -------------------------------- ### Execute Pest Tests Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Commands for running the test suite with specific options. ```bash php artisan test --compact ``` ```bash php artisan test --compact --filter=testName ``` -------------------------------- ### Access TryPost API with cURL Source: https://github.com/trypost-it/trypost/blob/main/README.md Use this command to make requests to the TryPost REST API. Replace 'tp_your_token' with your actual Bearer token and 'your-domain.com' with your TryPost domain. ```bash curl -H "Authorization: Bearer tp_your_token" \ https://your-domain.com/api/posts ``` -------------------------------- ### List Labels Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves all labels defined in the current workspace. ```bash curl -X GET "https://your-domain.com/api/labels" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" ``` -------------------------------- ### List API Keys API Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves all API keys for the workspace. Note that actual token values are not returned, only hints. ```APIDOC ## List API Keys ### Description Retrieves all API keys for the workspace. Note that actual token values are not returned, only hints. ### Method GET ### Endpoint /api/api-keys ### Response #### Success Response (200 OK) - **data** (array) - A list of API key objects. - **id** (string) - The unique identifier of the API key. - **name** (string) - The name of the API key. - **key_hint** (string) - A partial hint of the API key token. - **status** (string) - The status of the API key (e.g., "active"). - **last_used_at** (string or null) - Timestamp of the last usage, or null if never used. - **expires_at** (string) - Timestamp when the API key expires. - **created_at** (string) - Timestamp of creation. #### Response Example ```json { "data": [ { "id": "ee0e8400-e29b-41d4-a716-446655440010", "name": "Production API Key", "key_hint": "tp_abc123...xyz789", "status": "active", "last_used_at": "2024-12-15 10:00:00", "expires_at": "2025-12-15 00:00:00", "created_at": "2024-12-01 00:00:00" } ] } ``` ``` -------------------------------- ### List Workspace Posts Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves a paginated list of posts for the current workspace, sorted by scheduled date. ```bash curl -X GET "https://your-domain.com/api/posts" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" # Response (200 OK) # { # "data": [ # { # "id": "550e8400-e29b-41d4-a716-446655440000", # "status": "scheduled", # "synced": true, # "scheduled_at": "2024-12-20 09:00:00", # "published_at": null, # "platforms": [ # { # "id": "660e8400-e29b-41d4-a716-446655440001", # "platform": "x", # "content": "Check out our latest blog post! #tech #startup", # "content_type": "x_post", # "status": "pending", # "enabled": true, # "social_account": { # "id": "770e8400-e29b-41d4-a716-446655440002", # "platform": "x", # "display_name": "TryPost", # "username": "trypost", # "is_active": true, # "status": "connected" # } # } # ], # "labels": [ # { # "id": "880e8400-e29b-41d4-a716-446655440003", # "name": "Marketing", # "color": "#FF5733" # } # ], # "created_at": "2024-12-15 10:30:00", # "updated_at": "2024-12-15 10:30:00" # } # ], # "links": {...}, # "meta": {...} # } ``` -------------------------------- ### Create API Key API Source: https://context7.com/trypost-it/trypost/llms.txt Creates a new API key. The full token is only returned once during creation. ```APIDOC ## Create API Key ### Description Creates a new API key. The full token is only returned once during creation. ### Method POST ### Endpoint /api/api-keys ### Parameters #### Request Body - **name** (string) - Required - The name for the new API key. - **expires_at** (string) - Optional - The expiration date for the API key in YYYY-MM-DD format. If omitted, the key never expires. ### Request Example ```json { "name": "CI/CD Pipeline Key", "expires_at": "2025-06-01" } ``` ### Response #### Success Response (201 Created) - **token** (object) - Contains details of the created API key. - **id** (string) - The unique identifier of the API key. - **name** (string) - The name of the API key. - **key_hint** (string) - A partial hint of the API key token. - **status** (string) - The status of the API key. - **last_used_at** (string or null) - Timestamp of the last usage. - **expires_at** (string) - Timestamp when the API key expires. - **created_at** (string) - Timestamp of creation. - **plain_token** (string) - The full, unmasked API key token. This is only returned once upon creation. #### Response Example ```json { "token": { "id": "ff0e8400-e29b-41d4-a716-446655440011", "name": "CI/CD Pipeline Key", "key_hint": "tp_def456...uvw012", "status": "active", "last_used_at": null, "expires_at": "2025-06-01 00:00:00", "created_at": "2024-12-15 12:00:00" }, "plain_token": "tp_def456789abcdef0123456789abcdef0123456789abcd" } ``` ### IMPORTANT - Store the `plain_token` securely, as it cannot be retrieved again. ``` -------------------------------- ### Authenticate with TryPost API Source: https://context7.com/trypost-it/trypost/llms.txt All API requests must include an Authorization header with a valid Bearer token. Requests without a valid token or active subscription will return 401 or 402 status codes. ```bash # All API requests require the Authorization header curl -X GET "https://your-domain.com/api/posts" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" # Response for missing token (401 Unauthorized) # {"message": "Missing API key."} # Response for invalid token (401 Unauthorized) # {"message": "Invalid API key."} # Response for expired token (401 Unauthorized) # {"message": "API key has expired."} # Response when subscription required (402 Payment Required) # {"message": "Active subscription required."} ``` -------------------------------- ### Execute PHP via Artisan Tinker Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Use single quotes for the command to prevent shell expansion, and double quotes for internal PHP strings. ```bash php artisan tinker --execute 'Your::code();' ``` ```bash php artisan tinker --execute 'User::where("active", true)->count();' ``` -------------------------------- ### Configure Post-it Button Styles Source: https://github.com/trypost-it/trypost/blob/main/maizzle/components/button.html Defines alignment options and dynamically constructs inline styles for a button component based on its properties. It handles background and text colors, defaulting to dark gray and white if not specified. ```javascript let align = { left: 'text-left', center: 'text-center', right: 'text-right', } [props.align] || '' let styles = [ 'display: inline-block;', 'text-decoration: none;', 'padding: 16px 24px;', 'font-size: 16px;', 'line-height: 1;', 'border-radius: 8px;', ] let hasBgClass = () => props.class && props.class.split(' ').some(c => c.startsWith('bg-')) if (props['bg-color'] && !hasBgClass()) { styles.push(`background-color: ${props['bg-color']};`) } else { styles.push('background-color: #262626;') } if (props.color) { styles.push(`color: ${props.color};`) } else { styles.push('color: #ffffff;') } module.exports = { align, href: props.href, styles: styles.join(''), msoPt: props['mso-pt'] || '16px', msoPb: props['mso-pb'] || '31px', } ``` -------------------------------- ### POST /api/posts Source: https://context7.com/trypost-it/trypost/llms.txt Creates a new post with platform-specific content and scheduling information. ```APIDOC ## POST /api/posts ### Description Creates a new post with platform-specific content. Each platform entry requires a social account ID and content type. The post status can be draft, scheduled, or publishing. ### Method POST ### Endpoint /api/posts ### Parameters #### Request Body - **platforms** (array) - Required - List of platform-specific content objects - **scheduled_at** (string) - Required - ISO 8601 timestamp - **status** (string) - Required - Post status (draft, scheduled, publishing) ### Request Example { "platforms": [ { "social_account_id": "770e8400-e29b-41d4-a716-446655440002", "content_type": "x_post", "content": "Excited to announce our new feature!" } ], "scheduled_at": "2024-12-25T14:00:00Z", "status": "scheduled" } ### Response #### Success Response (201) - **data** (object) - The created post object ``` -------------------------------- ### Generate Laravel Tests Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Commands for creating feature and unit tests using Artisan. ```bash php artisan make:test [options] {name} ``` ```bash php artisan make:test --pest {name} ``` -------------------------------- ### Configure VML v-fill Module Source: https://github.com/trypost-it/trypost/blob/main/maizzle/components/v-fill.html Defines the default configuration for the v-fill module, including dimensions, aspect ratio, colors, and image source. Use this to customize VML element appearance. ```javascript module.exports = { width: props.width || '600px', type: props.type || 'frame', sizes: props.sizes, origin: props.origin, position: props.position, aspect: props.aspect, color: props.color, inset: props.inset || '0,0,0,0', stroke: props.stroke || 'f', strokecolor: props.strokecolor, fill: props.fill || 't', fillcolor: props.fillcolor || 'none', image: props.image || 'https://via.placeholder.com/600x400' } ``` -------------------------------- ### Wayfinder Invokable Controller Usage Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Import and invoke controller actions directly as functions. ```javascript import StorePost from '@/actions/.../StorePostController'; StorePost() ``` -------------------------------- ### Create Label API Source: https://context7.com/trypost-it/trypost/llms.txt Creates a new label with a name and hex color code. ```APIDOC ## Create Label ### Description Creates a new label with a name and hex color code. ### Method POST ### Endpoint /api/labels ### Parameters #### Request Body - **name** (string) - Required - The name of the label. - **color** (string) - Required - The hex color code for the label (e.g., "#9B59B6"). Must be in the format #RRGGBB. ### Request Example ```json { "name": "Announcements", "color": "#9B59B6" } ``` ### Response #### Success Response (201 Created) - **data** (object) - Contains the newly created label details. - **id** (string) - The unique identifier of the label. - **name** (string) - The name of the label. - **color** (string) - The hex color code of the label. - **created_at** (string) - Timestamp of creation. - **updated_at** (string) - Timestamp of last update. #### Response Example ```json { "data": { "id": "dd0e8400-e29b-41d4-a716-446655440009", "name": "Announcements", "color": "#9B59B6", "created_at": "2024-12-15 11:30:00", "updated_at": "2024-12-15 11:30:00" } } ``` ### Notes - Color must be a valid hex code in format #RRGGBB. ``` -------------------------------- ### Update Label Source: https://context7.com/trypost-it/trypost/llms.txt Modifies the name or color of an existing label. ```bash curl -X PUT "https://your-domain.com/api/labels/880e8400-e29b-41d4-a716-446655440003" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Marketing Campaigns", "color": "#E74C3C" }' ``` -------------------------------- ### Retrieve Single Post Source: https://context7.com/trypost-it/trypost/llms.txt Fetches details for a specific post by its unique ID. ```bash curl -X GET "https://your-domain.com/api/posts/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" # Response (200 OK) # { # "data": { # "id": "550e8400-e29b-41d4-a716-446655440000", # "status": "draft", # "synced": true, # "scheduled_at": "2024-12-20 09:00:00", # "published_at": null, # "platforms": [...], # "labels": [...], # "created_at": "2024-12-15 10:30:00", # "updated_at": "2024-12-15 10:30:00" # } # } # Response for non-existent post (404 Not Found) ``` -------------------------------- ### Generate Spacer Component Styles Source: https://github.com/trypost-it/trypost/blob/main/maizzle/components/spacer.html Calculates CSS line-height and MSO-specific height styles based on component properties. ```javascript // https://maizzle.com/docs/components/spacer let styles = [] if (props.height) { styles.push(`line-height: ${props.height};`) } if (props['mso-height']) { styles.push(`mso-line-height-alt: ${props['mso-height']};`) } module.exports = { height: props.height, styles: styles.join('') } ``` -------------------------------- ### Import Tabler Icons Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Syntax for importing specific icons from the Tabler library. ```typescript import { IconCheck, IconX } from '@tabler/icons-vue' ``` -------------------------------- ### List Social Accounts API Request Source: https://context7.com/trypost-it/trypost/llms.txt Fetches a list of all connected social media accounts within the workspace, sorted by platform. ```bash curl -X GET "https://your-domain.com/api/social-accounts" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" ``` -------------------------------- ### List Labels API Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves all labels for the workspace. Labels help organize and categorize posts. ```APIDOC ## List Labels ### Description Retrieves all labels for the workspace. Labels help organize and categorize posts. ### Method GET ### Endpoint /api/labels ### Response #### Success Response (200 OK) - **data** (array) - A list of label objects. - **id** (string) - The unique identifier of the label. - **name** (string) - The name of the label. - **color** (string) - The hex color code of the label (e.g., "#FF5733"). - **created_at** (string) - Timestamp of creation. - **updated_at** (string) - Timestamp of last update. #### Response Example ```json { "data": [ { "id": "880e8400-e29b-41d4-a716-446655440003", "name": "Marketing", "color": "#FF5733", "created_at": "2024-12-01 10:00:00", "updated_at": "2024-12-01 10:00:00" }, { "id": "880e8400-e29b-41d4-a716-446655440008", "name": "Product", "color": "#3498DB", "created_at": "2024-12-01 10:00:00", "updated_at": "2024-12-01 10:00:00" } ] } ``` ``` -------------------------------- ### Explicit Method Type Hinting Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Enforce strict typing for all method parameters and return values. ```php function isAccessible(User $user, ?string $path = null): bool ``` -------------------------------- ### Enum Key Naming Convention Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Use TitleCase for all Enum keys. ```php FavoritePerson, BestLake, Monthly ``` -------------------------------- ### Generate Wayfinder Routes Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Command to regenerate TypeScript route helpers after modifying PHP routes. ```bash php artisan wayfinder:generate ``` -------------------------------- ### Create Hashtag Group API Request Source: https://context7.com/trypost-it/trypost/llms.txt Creates a new group for hashtags, defined by a name and a string of hashtags. ```bash curl -X POST "https://your-domain.com/api/hashtags" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Marketing Campaign", "hashtags": "#marketing #growth #socialmedia #branding" }' ``` -------------------------------- ### Create Hashtag Group Source: https://context7.com/trypost-it/trypost/llms.txt Creates a new hashtag group with a name and hashtag string. ```APIDOC ## POST /api/hashtags ### Description Creates a new hashtag group with a name and hashtag string. ### Method POST ### Endpoint /api/hashtags ### Parameters #### Request Body - **name** (string) - Required - The name of the hashtag group. - **hashtags** (string) - Required - A string containing the hashtags (e.g., "#marketing #growth"). ### Request Example ```json { "name": "Marketing Campaign", "hashtags": "#marketing #growth #socialmedia #branding" } ``` ### Response #### Success Response (201 Created) - **data** (object) - Contains the details of the newly created hashtag group. - **id** (string) - The unique identifier of the hashtag group. - **name** (string) - The name of the hashtag group. - **hashtags** (string) - The string of hashtags. - **created_at** (string) - The timestamp when the hashtag group was created. ### Response Example ```json { "data": { "id": "cc0e8400-e29b-41d4-a716-446655440007", "name": "Marketing Campaign", "hashtags": "#marketing #growth #socialmedia #branding", "created_at": "2024-12-15 11:00:00" } } ``` ``` -------------------------------- ### Wayfinder Query Parameter Appending Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Pass a query object in the options to append parameters to the generated URL. ```javascript show(1, { query: { page: 1 } }) ``` -------------------------------- ### Tailwind CSS Configuration Source: https://github.com/trypost-it/trypost/blob/main/maizzle/layouts/main.html Includes Tailwind CSS directives for components and utilities, with a custom style for images. ```CSS @tailwind components; @tailwind utilities; img { @apply max-w-full align-middle; } ``` -------------------------------- ### Inertia Client Navigation Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Use the Link component for client-side navigation within Vue applications. ```vue import { Link } from '@inertiajs/vue3' Home ``` -------------------------------- ### Access Array Data Safely Source: https://github.com/trypost-it/trypost/blob/main/CLAUDE.md Use the data_get helper to access array values with optional fallback defaults. ```php data_get($data, 'name') ``` ```php data_get($data, 'username', $sender->username) ``` -------------------------------- ### Wayfinder Form Component (Vue) Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Shows how to bind Wayfinder store actions to an Inertia Form component. ```vue
``` -------------------------------- ### Wayfinder Named Route Usage Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Import named routes from the routes directory for type-safe navigation. ```javascript import { show } from '@/routes/post'; show(1) ``` -------------------------------- ### Wayfinder Form Integration Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Use the form method to generate HTML form attributes automatically. ```jsx
``` -------------------------------- ### List Social Accounts Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves all connected social media accounts for the workspace, ordered by platform. ```APIDOC ## GET /api/social-accounts ### Description Retrieves all connected social media accounts for the workspace, ordered by platform. ### Method GET ### Endpoint /api/social-accounts ### Response #### Success Response (200 OK) - **data** (array) - A list of connected social accounts. - **id** (string) - The unique identifier of the social account. - **platform** (string) - The social media platform (e.g., "x", "linkedin"). - **display_name** (string) - The display name of the account. - **username** (string) - The username of the account. - **is_active** (boolean) - Indicates if the account is currently active for posting. - **status** (string) - The connection status of the account (e.g., "connected"). ### Response Example ```json { "data": [ { "id": "770e8400-e29b-41d4-a716-446655440002", "platform": "x", "display_name": "TryPost", "username": "trypost", "is_active": true, "status": "connected" }, { "id": "770e8400-e29b-41d4-a716-446655440003", "platform": "linkedin", "display_name": "TryPost Inc", "username": "trypost-inc", "is_active": true, "status": "connected" } ] } ``` ### Supported Platforms linkedin, linkedin-page, x, tiktok, youtube, facebook, instagram, instagram-facebook, threads, pinterest, bluesky, mastodon ``` -------------------------------- ### Toggle Social Account API Request Source: https://context7.com/trypost-it/trypost/llms.txt Enables or disables a social media account for posting. Disabled accounts will not receive new posts. ```bash curl -X PUT "https://your-domain.com/api/social-accounts/770e8400-e29b-41d4-a716-446655440002/toggle" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" ``` -------------------------------- ### Tailwind CSS Flex Gap Spacing Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Use gap utilities for spacing between flex items instead of margins. ```html
Superior
Michigan
Erie
``` -------------------------------- ### Wayfinder HTTP Method Invocation Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Call specific HTTP methods on route actions to return URL and method objects. ```javascript show.head(1) → { url: "/posts/1", method: "head" } ``` -------------------------------- ### Update Post API Request Source: https://context7.com/trypost-it/trypost/llms.txt Use this endpoint to modify an existing post's content, schedule, status, and labels. Note that posts already published cannot be updated. ```bash curl -X PUT "https://your-domain.com/api/posts/550e8400-e29b-41d4-a716-446655440000" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "status": "scheduled", "synced": true, "platforms": [ { "id": "660e8400-e29b-41d4-a716-446655440001", "content": "Updated content for this post! #updated", "content_type": "x_post", "meta": null } ], "scheduled_at": "2024-12-26T10:00:00Z", "label_ids": ["880e8400-e29b-41d4-a716-446655440003"] }' ``` -------------------------------- ### Generate Divider Styles Source: https://github.com/trypost-it/trypost/blob/main/maizzle/components/divider.html Processes component properties to build a CSS string for a divider element, including conditional background colors and margin spacing. ```javascript // https://maizzle.com/docs/components/divider let styles = [ `height: ${props.height || '1px'};`, `line-height: ${props.height || '1px'};`, ] /** * Color * * If a Tailwind background color class was passed, use it. * Otherwise, the `color` prop will take precedence if * as long as it was passed. */ let hasBgClass = () => props.class && props.class.split(' ').some(c => c.startsWith('bg-')) if (props.color) { styles.push(`background-color: ${props.color};`) } if (!props.color && !hasBgClass()) { styles.push(`background-color: #cbd5e1;`) } /** * Margins * * If any margin prop was passed, add `margin: 0` first. * It's important that this comes first, so inlining * does not use it to override existing margins. */ if (props.top || props.bottom || props.left || props.right || props['space-y'] || props['space-x']) { styles.push('margin: 0;') } props['space-y'] = props['space-y'] === 0 ? '0px' : props['space-y'] || '24px' if (props['space-y']) { styles.push(`margin-top: ${props['space-y']}; margin-bottom: ${props['space-y']};`) } props['space-x'] = props['space-x'] === 0 ? '0px' : props['space-x'] if (props['space-x']) { styles.push(`margin-left: ${props['space-x']}; margin-right: ${props['space-x']};`) } props.top = props.top === 0 ? '0px' : props.top if (props.top) { styles.push(`margin-top: ${props.top};`) } props.bottom = props.bottom === 0 ? '0px' : props.bottom if (props.bottom) { styles.push(`margin-bottom: ${props.bottom};`) } props.left = props.left === 0 ? '0px' : props.left if (props.left) { styles.push(`margin-left: ${props.left};`) } props.right = props.right === 0 ? '0px' : props.right if (props.right) { styles.push(`margin-right: ${props.right};`) } module.exports = { styles: styles.join(''), } ``` -------------------------------- ### Limit Eagerly Loaded Records in Laravel 12 Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Use native query limiting for eager loading without requiring external packages. ```php $query->latest()->limit(10); ``` -------------------------------- ### List Hashtag Groups Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves all hashtag groups for the workspace. Hashtag groups allow reusing sets of hashtags across posts. ```APIDOC ## GET /api/hashtags ### Description Retrieves all hashtag groups for the workspace. Hashtag groups allow reusing sets of hashtags across posts. ### Method GET ### Endpoint /api/hashtags ### Response #### Success Response (200 OK) - **data** (array) - A list of hashtag groups. - **id** (string) - The unique identifier of the hashtag group. - **name** (string) - The name of the hashtag group. - **hashtags** (string) - A string containing the hashtags (e.g., "#tech #ai #startup"). - **created_at** (string) - The timestamp when the hashtag group was created. - **updated_at** (string) - The timestamp when the hashtag group was last updated. ### Response Example ```json { "data": [ { "id": "bb0e8400-e29b-41d4-a716-446655440006", "name": "Tech Stack", "hashtags": "#tech #ai #startup #innovation", "created_at": "2024-12-01 10:00:00", "updated_at": "2024-12-01 10:00:00" } ] } ``` ``` -------------------------------- ### Delete API Key Source: https://context7.com/trypost-it/trypost/llms.txt Revokes access by permanently deleting an API key. ```bash curl -X DELETE "https://your-domain.com/api/api-keys/ee0e8400-e29b-41d4-a716-446655440010" \ -H "Authorization: Bearer tp_your_api_key_here" ``` -------------------------------- ### Wayfinder Query Merging Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Merge current URL search parameters with new values, setting to null to remove. ```javascript show(1, { mergeQuery: { page: 2, sort: null } }) ``` -------------------------------- ### List Hashtag Groups API Request Source: https://context7.com/trypost-it/trypost/llms.txt Retrieves all existing hashtag groups associated with the workspace. These groups facilitate the reuse of hashtag sets across multiple posts. ```bash curl -X GET "https://your-domain.com/api/hashtags" \ -H "Authorization: Bearer tp_your_api_key_here" \ -H "Content-Type: application/json" ``` -------------------------------- ### Update Post Source: https://context7.com/trypost-it/trypost/llms.txt Updates an existing post's content, schedule, status, and labels. Cannot update posts that have already been published. ```APIDOC ## PUT /api/posts/{postId} ### Description Updates an existing post's content, schedule, status, and labels. Cannot update posts that have already been published. ### Method PUT ### Endpoint /api/posts/{postId} ### Parameters #### Path Parameters - **postId** (string) - Required - The unique identifier of the post to update. #### Request Body - **status** (string) - Optional - The new status for the post (e.g., "scheduled", "draft"). - **synced** (boolean) - Optional - Whether to sync the post across platforms. - **platforms** (array) - Optional - An array of platform-specific updates. - **id** (string) - Required - The ID of the platform entry to update. - **content** (string) - Optional - The updated content for the post on this platform. - **content_type** (string) - Optional - The type of content for this platform (e.g., "x_post", "instagram_reel"). - **meta** (object) - Optional - Additional metadata for the platform. - **scheduled_at** (string) - Optional - The date and time to schedule the post (ISO 8601 format). - **label_ids** (array) - Optional - An array of label IDs to associate with the post. ### Request Example ```json { "status": "scheduled", "synced": true, "platforms": [ { "id": "660e8400-e29b-41d4-a716-446655440001", "content": "Updated content for this post! #updated", "content_type": "x_post", "meta": null } ], "scheduled_at": "2024-12-26T10:00:00Z", "label_ids": ["880e8400-e29b-41d4-a716-446655440003"] } ``` ### Response #### Success Response (200 OK) - **data** (object) - Contains the updated post details. - **id** (string) - The unique identifier of the post. - **status** (string) - The current status of the post. - ... (other post fields) #### Error Response (422 Unprocessable Entity) - **message** (string) - Error message indicating the post cannot be edited (e.g., "Cannot edit a published post."). ``` -------------------------------- ### Toggle Social Account Source: https://context7.com/trypost-it/trypost/llms.txt Enables or disables a social account for posting. Disabled accounts will not receive posts. ```APIDOC ## PUT /api/social-accounts/{socialAccountId}/toggle ### Description Enables or disables a social account for posting. Disabled accounts will not receive posts. ### Method PUT ### Endpoint /api/social-accounts/{socialAccountId}/toggle ### Parameters #### Path Parameters - **socialAccountId** (string) - Required - The unique identifier of the social account to toggle. ### Response #### Success Response (200 OK) - **data** (object) - Contains the updated social account details. - **id** (string) - The unique identifier of the social account. - **platform** (string) - The social media platform. - **display_name** (string) - The display name of the account. - **username** (string) - The username of the account. - **is_active** (boolean) - The new active status of the account. - **status** (string) - The connection status of the account. ### Response Example ```json { "data": { "id": "770e8400-e29b-41d4-a716-446655440002", "platform": "x", "display_name": "TryPost", "username": "trypost", "is_active": false, "status": "connected" } } ``` ``` -------------------------------- ### Wayfinder URL Extraction Source: https://github.com/trypost-it/trypost/blob/main/GEMINI.md Retrieve the URL string directly from a route action. ```javascript show.url(1) ```