PHPackages                             askancy/laravel-shortcode-plus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. askancy/laravel-shortcode-plus

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

askancy/laravel-shortcode-plus
==============================

A package that allows you to use custom shortcodes

v4.1.8(2y ago)05MITPHPPHP ^8.1|^8.2

Since Oct 30Pushed 2y agoCompare

[ Source](https://github.com/Askancy/laravel-shortcode-plus)[ Packagist](https://packagist.org/packages/askancy/laravel-shortcode-plus)[ Docs](https://github.com/murdercode/laravel-shortcode-plus)[ RSS](/packages/askancy-laravel-shortcode-plus/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (15)Versions (61)Used By (0)

[![Logo Laravel Shortcode Plus](https://github.com/murdercode/laravel-shortcode-plus/raw/HEAD/art/laravel-shortcode-logo.svg)](https://github.com/murdercode/laravel-shortcode-plus/raw/HEAD/art/laravel-shortcode-logo.svg)

[![Latest Version on Packagist](https://camo.githubusercontent.com/87c106767d6ead736e64b8f17cf87fd577602f464eaa35827eca75921a5766b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d7572646572636f64652f6c61726176656c2d73686f7274636f64652d706c75732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/murdercode/laravel-shortcode-plus)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6959b122b6e992b9f216f8c7e607feff104d19452b103dd50bbb9e1b0232d2b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d7572646572636f64652f6c61726176656c2d73686f7274636f64652d706c75732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d70657374)](https://github.com/murdercode/laravel-shortcode-plus/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub PHPStan](https://camo.githubusercontent.com/e910a2c71551b51afed33f3edce2143c15f08266e0a4eba443d818c3778c28fe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d7572646572636f64652f6c61726176656c2d73686f7274636f64652d706c75732f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e)](https://github.com/murdercode/laravel-shortcode-plus/actions?query=workflow%3Aphpstan+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6a7635300269aefc4132b36ae2fad3a1d197bc9dd45986aab992c0329ae5de03/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d7572646572636f64652f6c61726176656c2d73686f7274636f64652d706c75732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d70696e74)](https://github.com/murdercode/laravel-shortcode-plus/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Maintainability](https://camo.githubusercontent.com/846f204541e802c23284ff06ee1a682da549e51ffa6205c3cd35ddd66e6a991f/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65626631303033383232626165646535363536372f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/murdercode/laravel-shortcode-plus/maintainability)[![Test Coverage](https://camo.githubusercontent.com/a3928cad582d519f404d03c3fc4a0f24a6cefbe28009101c03807ecf1ead0c9a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f65626631303033383232626165646535363536372f746573745f636f766572616765)](https://codeclimate.com/github/murdercode/laravel-shortcode-plus/test_coverage)[![License Mit](https://camo.githubusercontent.com/b3b89520b53d06cd919b8156fa18efa8b86e5498d0989dc1ccc1568e14ede1f1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d7572646572636f64652f6c61726176656c2d73686f7274636f64652d706c7573)](https://camo.githubusercontent.com/b3b89520b53d06cd919b8156fa18efa8b86e5498d0989dc1ccc1568e14ede1f1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d7572646572636f64652f6c61726176656c2d73686f7274636f64652d706c7573)[![Total Downloads](https://camo.githubusercontent.com/ab66147704865a972bab46025cf76dbadac49905aa66fa34fcd947bc1c3bab59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d7572646572636f64652f6c61726176656c2d73686f7274636f64652d706c75732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/murdercode/laravel-shortcode-plus)

---

Why Shortcode+?
---------------

[](#why-shortcode)

This package allows you to use shortcodes in your application, like a Wordpress / BBS style websites.

In our days, shortcodes are a great way to preserve the integrity of the data within the content published on our site (such as a blog or forum) without risking having to rewrite the format each time.

With Laravel Shortcode+ we have the ability to turn a standard shortcode into a dynamic asset that can update over time (new HTML standards, cookie consent, AMP versions, and more)!

**Warning: this is a very opinionated package and it's not intended to be multi-purpose.**

How it Works
------------

[](#how-it-works)

For example, you can use the following shortcode to embed a Youtube video:

```
[youtube id="123456789"]
```

This will be rendered as:

```

```

As you can see, we don't just generate an iframe but make it accessible, performant and in line with the best SEO practices around.

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require murdercode/laravel-shortcode-plus
```

You can use shortcodes CSS publishing the assets:

```
php artisan vendor:publish --tag="shortcode-plus-assets"
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="shortcode-plus-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="shortcode-plus-config"
```

If you want to upgrade every time your assets, add in your composer.json:

```
    "scripts": {
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=shortcode-plus-assets --ansi --force",
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="shortcode-plus-views"
```

Usage
-----

[](#usage)

Laravel Shortcode Plus is shipped with a default CSS and JS for a better user experience. You can add on **resources/css/app.css** the CSS files:

```
@import url("/public/vendor/shortcode-plus/app.css");
```

and in **resources/js/app.js** the JS files:

```
import '/public/vendor/shortcode-plus/app2.js';
```

Now you can parse your source as follows:

```
use Murdercode\LaravelShortcodePlus\Facades\LaravelShortcodePlus;

$html = "I want to parse this twitter tag: [twitter url=\"https://twitter.com/elonmusk/status/1585841080431321088\"]";
return LaravelShortcodePlus::source($html)->parseAll();
```

Parsers
-------

[](#parsers)

Here is the list of the available parsers:

ShortcodeDescriptionParametersExample`[twitter]  `Get a Twitter card`url``[twitter url="https://twitter.com/elonmusk/status/1585841080431321088"]``[youtube]`Get a Youtube (light) player`url``[youtube url="https://www.youtube.com/watch?v=9bZkp7q19f0"]``[spotify]`Get a Spotify player`url` or `uri``[spotify url="https://open.spotify.com/track/2TpxZ7JUBn3uw46aR7qd6V"]``[faq]`Create a `` tag with embedded content`title``[faq title="What is the answer to the ultimate question?"]42[/faq]``[spoiler]`Create a `` tag with embedded content`title``[spoiler title="Spoiler"]This is hidden content[/spoiler]``[facebook]`Get a Facebook card`url``[facebook url="https://www.facebook.com/elonmusk/posts/10157744420210129"]``[instagram]`Get a Instagram card`url``[instagram url="https://www.instagram.com/p/CApQfIjBGxC/"]``[image]`Create an image with `Image::class` model`id`, `caption` (optional)`[image id="123"]``[gallery]`Create a gallery image with `Image::class` model`title`, `images`Single or multiple images: `[gallery title="Gallery title here" images="1"]` or `[gallery title="Gallery title here" images="1,2,3"]``[photo]`Create a gallery image with `[Nova Media Hub](https://github.com/outl1ne/nova-media-hub)` model`didascalia` `effect`(optional)Single or multiple images: `[photo didascalia="Gallery title here" id="1,2,3"]` Effect \[photo id="1,2,3" effect="carousel`[leggianche]`Create a Read more div, based on `Article` or `Post` model`id``[leggianche id="1"]``[distico]`Create a side text block, based on `Article` or `Post` model`id``[distico id="1"]``[button]`Create a button that links to an URL`link`, `label`, `level (optional)``[button link="https://www.google.com" label="Google" level="primary/secondary"]``[tmdb]`Create a TMDB card`type`, `id``[tmdb type="movie/tv" id="123"]``[widgetbay]`Create a Widgetbay iframe`id (optional)`, `link (optional)``[widgetbay id="1"]` `[widgetbay link="https://www.amazon.it/product?tag="41515&subtag="5151"..."]`### Note for Facebook

[](#note-for-facebook)

Please remember to call the SDK before ``:

```

```

### Note for Twitter

[](#note-for-twitter)

Please remember to call the SDK before ``:

```

    window.twttr = (function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0],
            t = window.twttr || {};
        if (d.getElementById(id)) return t;
        js = d.createElement(s);
        js.id = id;
        js.src = "https://platform.twitter.com/widgets.js";
        fjs.parentNode.insertBefore(js, fjs);

        t._e = [];
        t.ready = function(f) {
            t._e.push(f);
        };

        return t;
    }(document, "script", "twitter-wjs"));

```

### Note for Reddit

[](#note-for-reddit)

Please remember to call the SDK before ``:

```

```

### Note for Justwatch

[](#note-for-justwatch)

Please remember to call the SDK before ``:

```

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Stefano Novelli](https://github.com/murdercode)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 60.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Recently: every ~1 days

Total

51

Last Release

875d ago

Major Versions

v0.0.5 → v1.0.02022-11-02

v1.2.5 → v2.0.02023-02-13

v2.1.8 → v3.0.02023-08-23

v3.0.12 → v4.0.02023-10-30

PHP version history (2 changes)v0.0.1PHP ^8.1

v2.0.2PHP ^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0774a513bb5b13d7d314c88cbce01726eddb0e4282a0899116ab3ece887ceda6?d=identicon)[Askancy](/maintainers/Askancy)

---

Top Contributors

[![murdercode](https://avatars.githubusercontent.com/u/7630252?v=4)](https://github.com/murdercode "murdercode (253 commits)")[![Claudio-Emmolo](https://avatars.githubusercontent.com/u/113107618?v=4)](https://github.com/Claudio-Emmolo "Claudio-Emmolo (110 commits)")[![DispatchCode](https://avatars.githubusercontent.com/u/4256708?v=4)](https://github.com/DispatchCode "DispatchCode (23 commits)")[![Askancy](https://avatars.githubusercontent.com/u/789702?v=4)](https://github.com/Askancy "Askancy (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")

---

Tags

laravelshortcodesembedshortcodemurdercodelaravel-shortcode-plus

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/askancy-laravel-shortcode-plus/health.svg)

```
[![Health](https://phpackages.com/badges/askancy-laravel-shortcode-plus/health.svg)](https://phpackages.com/packages/askancy-laravel-shortcode-plus)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[maestroerror/laragent

Power of AI Agents in your Laravel project

630106.4k](/packages/maestroerror-laragent)[nativephp/mobile

NativePHP for Mobile

82724.0k43](/packages/nativephp-mobile)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[spatie/laravel-rdap

Perform RDAP queries in a Laravel app

72108.3k2](/packages/spatie-laravel-rdap)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
