Download the PHP package webwizo/laravel-shortcodes-filament without Composer

On this page you can find all versions of the php package webwizo/laravel-shortcodes-filament. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-shortcodes-filament

Laravel Shortcodes — Filament Plugin

Latest Version on Packagist Total Downloads License

Manage Laravel Shortcodes directly from your Filament admin panel.

A Filament v3 plugin for webwizo/laravel-shortcodes that lets content editors create, manage, and use shortcodes without touching PHP code.

Create reusable static or dynamic shortcodes, define attributes, build HTML templates, connect shortcodes to live database records, and scope everything to your Filament tenants.

✨ What you get

Built on top of the battle-tested webwizo/laravel-shortcodes package.


Features


Requirements

Dependency Version
PHP ^8.2
Laravel ^11.0 | ^12.0
Filament ^3.0
webwizo/laravel-shortcodes ^1.0

Installation

Install the package via Composer:

Publish the config and migration:

Register the plugin in your Filament panel provider:


Usage

Writing shortcodes in content

Once a shortcode is created in the panel, editors can embed it anywhere:

To render shortcodes in a Blade view, use the webwizo/laravel-shortcodes parser:

For full IDE autocompletion (compile, strip, register, etc.), import the facade provided by this package instead of the vendor one:


Creating a shortcode in the panel

  1. Navigate to Content → Shortcodes in the sidebar
  2. Click New Shortcode
  3. Fill in:
    • Tag — the shortcode name used in content, e.g. store (lowercase, hyphens allowed)
    • Label — human-readable name shown in the panel
    • Type — Static for pure HTML/attribute templates, Dynamic to attach a live DB data source
    • Attributes — named parameters editors can pass, each with an optional default value
    • Dynamic Data Source (Dynamic type only) — pick the table, lookup column, and which shortcode attribute holds the lookup value
    • Template — the HTML output, using placeholders described below
  4. Save — the shortcode is immediately live

Template placeholders

Placeholder Replaced with
{{content}} The inner content between opening and closing tags
{{attr_name}} The value of a named attribute, falling back to its default
{{db.column_name}} A column from the dynamic data source row

Example template:

Used in content as:


Shortcode types

Every shortcode has a Type:

Dynamic data sources

Set the shortcode type to Dynamic and fill in the Dynamic Data Source section:

Then reference any column from that row in your template with {{db.column_name}}.

Used in content as:

Validation behaviour:

Results are cached for 600 seconds by default (configurable via cache_ttl).


Configuration

After publishing, edit config/shortcodes-filament.php:


Plugin fluent API

All options can also be set inline in the panel provider, which takes precedence over the config file:


Without multi-tenancy

If your app does not use Filament's multi-tenant system, simply leave tenant.model as null in the config (the default). The migration will create a clean shortcodes table with no foreign key column, and tags will be unique globally.


Adding multi-tenancy later

If you installed the package without multi-tenancy and want to add it later, the original migration has already run so you cannot re-run it. Instead, update your config with the tenant model, foreign key, and relationship, then run the built-in command:

The command will:

Then apply it:

The generated migration adds the FK column, drops the global UNIQUE(tag) index, and replaces it with a tenant-scoped UNIQUE(tenant_fk, tag) so the same tag can exist independently per tenant.


Multi-tenancy

The plugin has first-class support for Filament's multi-tenancy.

Basic setup

Pass your tenant model and relationship details on the plugin:

Tenant primary key types

The migration automatically uses the right column type for the foreign key based on your tenant model:

Tenant key type Column created
Auto-increment (int) UNSIGNED BIGINT
UUID (HasUuids) UUID (36 chars)
ULID (HasUlids) CHAR(26)
Custom string VARCHAR

Auto-detection is on by default — the migration inspects class_uses_recursive() on your tenant model and picks the right column type. You can override it explicitly:

Tenant model — required hasMany relationship

Filament's tenancy system requires your tenant model to declare a hasMany relationship back to the shortcodes table. Add this to your tenant model:

Replace team_id with whatever foreign key you configured. Without this relationship Filament will throw a "does not have a relationship" error when loading the panel.

Full multi-tenant example

1. Tenant model (app/Models/Team.php):

2. Panel provider (app/Providers/Filament/AdminPanelProvider.php):


Extending the model

You can swap in your own model by updating the config:

Your model should extend the package model to keep all functionality:


Changelog

Please see CHANGELOG.md for recent changes.


Contributing

Pull requests are welcome. For major changes please open an issue first to discuss what you would like to change.


❤️ Support Open Source

This plugin is open source and built on top of webwizo/laravel-shortcodes.

If this plugin saves you development time or makes managing shortcodes easier for your team, consider supporting its continued development.

Your support helps me:

☕ Buy me a coffee

☕ Support the project →

Even a small contribution helps me spend more time maintaining and improving open-source packages.

⭐ Other ways to help

You can also support the project without spending anything:

Thank you for using the plugin and supporting open source. ❤️


License

The MIT License (MIT). Please see LICENSE for more information.


Credits


All versions of laravel-shortcodes-filament with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
webwizo/laravel-shortcodes Version ^1.0
filament/filament Version ^3.0
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package webwizo/laravel-shortcodes-filament contains the following files

Loading the files please wait ...