Artisan Commands

This package registers the following Artisan commands. All commands are available after the package is installed.


Setup & Installation

textstem:post-install

Interactive wizard to run after first installing the package. Prompts to select an installation type (vanilla, Jetstream with Livewire, or Jetstream with Inertia) and then publishes config, components, JS/CSS assets, and Jetstream views.

php artisan textstem:post-install

textstem:refresh-assets

Clears the published JS/CSS files from public/vendor/medialight/textstem/ and republishes them from the package. Also ensures required resources/views/wrangler/ subdirectories exist and that the default page view and Prose component views are in place.

Run this after upgrading the package.

php artisan textstem:refresh-assets

textstem:publish-jetstream-views

Force-publishes Jetstream views to the host application. Useful when Jetstream views need to be refreshed separately from a full post-install.

php artisan textstem:publish-jetstream-views

textstem:dbseed

Seeds the database with sample data using the package's DatabaseSeeder.

php artisan textstem:dbseed

Code Generators

textstem:make:pagecomponent {name}

Scaffolds a new Wrangler page component. Creates the component class in app/Wrangler/Components/ and copies the sample view templates into resources/views/wrangler/components/{name}/.

php artisan textstem:make:pagecomponent HeroBlock
php artisan textstem:make:pagecomponent ImageGallery

Files created:

  • app/Wrangler/Components/HeroBlock.php
  • resources/views/wrangler/components/hero-block/ (sample views)

textstem:make:tool {name}

Scaffolds a new admin panel tool. Creates the tool class in app/Tools/ and a default view in resources/views/wrangler/tools/{name}/.

php artisan textstem:make:tool MyCustomTool

Files created:

  • app/Tools/MyCustomTool.php
  • resources/views/wrangler/tools/my-custom-tool/default.blade.php

The new tool will automatically appear at /textstem/tools/{name}.


textstem:make:module {name}

Scaffolds a full CRUD module including a model, controller, policy, store/update form requests, views, a Livewire data table, and domain action/filter config builders.

php artisan textstem:make:module Products

Files created:

  • app/Models/Product.php
  • app/Http/Controllers/ProductController.php
  • app/Policies/ProductPolicy.php
  • app/Http/Requests/ProductStoreRequest.php
  • app/Http/Requests/ProductUpdateRequest.php
  • app/Livewire/Tables/ProductTable.php
  • app/Domain/Products/Config/ProductActionBuilder.php
  • app/Domain/Products/Config/ProductFilterBuilder.php
  • resources/views/admin/products/ (index, create, edit, form-inputs views)

The command will prompt before overwriting any file that already exists.


textstem:make:collection {name} [--wc]

Scaffolds a new content collection. With the --wc flag, also creates an associated Wrangler component and view templates.

php artisan textstem:make:collection Events
php artisan textstem:make:collection Events --wc

textstem:make:dashboardwidget {name}

Scaffolds a new Livewire dashboard widget. Creates the component class under app/Livewire/DashboardWidgets/ and a default view under resources/views/livewire/dashboard-widgets/{name}/.

php artisan textstem:make:dashboardwidget RecentActivity

textstem:make:templatecommand {name}

Scaffolds a new Wrangler template command (a Blade directive usable within Wrangler page templates). Creates the class under app/Wrangler/TemplateCommands/ and copies the sample view into resources/views/wrangler/template-commands/{name}/.

php artisan textstem:make:templatecommand LatestPosts

Export

textstem:export-component [name] [--all] [--output=]

Exports a Wrangler page component to a ZIP file. The ZIP contains the component class and its view directory, suitable for importing via the Component Manager tool.

If name is omitted, an interactive list of available components is shown.

# Interactive selection
php artisan textstem:export-component

# Export a specific component
php artisan textstem:export-component HeroBlock

# Export all app components as individual ZIPs
php artisan textstem:export-component --all

# Custom output directory
php artisan textstem:export-component HeroBlock --output=/tmp/exports

Only components in app/Wrangler/Components/ are listed and exported (not package-bundled components).

Output defaults to storage/app/exports/{ComponentName}.zip.


textstem:export-widget [name] [--package] [--all] [--output=]

Exports a dashboard widget to a ZIP file suitable for importing via the Install Widget page.

If name is omitted, an interactive list of available widgets is shown. Use --package to export a widget bundled with the package rather than one in your app.

# Interactive selection
php artisan textstem:export-widget

# Export a specific widget
php artisan textstem:export-widget SiteOverview

# Export all app widgets as individual ZIPs
php artisan textstem:export-widget --all

# Export a package-bundled widget (rewrites namespace/view refs for the app)
php artisan textstem:export-widget SiteOverview --package

# Custom output directory
php artisan textstem:export-widget SiteOverview --output=/tmp/exports

ZIP structure produced:

SiteOverview.php          ← widget class (placed at app/Livewire/DashboardWidgets/ on import)
view/
  site-overview/
    default.blade.php     ← views (placed at resources/views/livewire/dashboard-widgets/ on import)

Only widgets in app/Livewire/DashboardWidgets/ are listed by default. Output defaults to storage/app/exports/{WidgetName}.zip.


textstem:export-tool {name} [--output=]

Exports an admin tool to a ZIP file suitable for importing via the Install Tool page at /textstem/tools/install.

The name is normalised — my-tool, MyTool, and my_tool all resolve to MyTool.

php artisan textstem:export-tool MyCustomTool
php artisan textstem:export-tool my-custom-tool
php artisan textstem:export-tool MyCustomTool --output=/tmp

ZIP structure produced:

MyCustomTool.php          ← tool class (placed at app/Tools/ on import)
view/
  default.blade.php       ← views (placed at resources/views/wrangler/tools/my-custom-tool/ on import)

Only tools in app/Tools/ can be exported. If the tool has associated Livewire components or other app files, add them manually under an install/ directory in the ZIP before distributing (e.g. install/app/Livewire/MyComponent.php). These will be copied to the matching project path on import.

Output defaults to storage/app/exports/{ToolName}.zip.


textstem:create-placeholders

Generates placeholder PNG images for each configured image size preset. Reads image_presets from config/textstemapp.php and writes files to storage/app/public/placeholders/{size}.png. Skips sizes that already have a placeholder file.

php artisan textstem:create-placeholders

Run this after changing image preset configuration or setting up a new environment.


Database

textstem:schema-compare [--keep-schema] [--schema-file=]

Compares the schema defined by the package and app migrations against the live database and reports any differences with suggested ALTER TABLE fix-up statements.

The command works in three steps:

  1. Creates a temporary database (same driver as the live connection), runs all migrations into it, then drops it.
  2. Extracts the ideal schema to a JSON snapshot file (default: storage/temp_schema_compare.json).
  3. Diffs the snapshot against the live database, reporting missing tables, missing or extra columns, type/nullability/default mismatches, and missing or different indexes.
php artisan textstem:schema-compare

# Keep the extracted JSON snapshot after the run
php artisan textstem:schema-compare --keep-schema

# Write the snapshot to a custom path
php artisan textstem:schema-compare --schema-file=/tmp/my-schema.json

Requires CREATE DATABASE privilege for MySQL/MariaDB. For SQLite, a temporary file is used instead.


textstem:migrations:sync [--batch=1]

Inserts all migration filenames found in database/migrations/ into the migrations table without actually running them. Useful when SQL has been applied manually to a production database and you need to bring the migrations ledger into sync.

php artisan textstem:migrations:sync

# Assign migrations to a specific batch number
php artisan textstem:migrations:sync --batch=5

Only inserts migrations not already recorded in the table. Already-recorded entries are left untouched.


textstem:model-check

Checks each Eloquent model against its corresponding database table and reports mismatches between fillable fields, casts, and the actual columns present.

php artisan textstem:model-check

Maintenance

cache:manage [action] [--warm-up]

Manages the application cache. The action argument defaults to clear.

Action Effect
clear Clears application, route, config, view, and compiled caches
warm-up Pre-warms frequently accessed content (recent news posts)

Use --warm-up with the clear action to clear and immediately warm up in one step.

php artisan cache:manage clear
php artisan cache:manage warm-up
php artisan cache:manage clear --warm-up

Note: unlike other Textstem commands, this uses the cache: prefix, not textstem:.


textstem:health-check [--notify]

Checks the health of the application and displays a status table. Checks performed:

Check What is verified
Database Connection can be established
esc