PHPackages                             vuetik/vuetik-laravel - 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. [API Development](/categories/api)
4. /
5. vuetik/vuetik-laravel

AbandonedArchivedLibrary[API Development](/categories/api)

vuetik/vuetik-laravel
=====================

VueTik Server Side Integrations &amp; Transformers for Laravel

2.0.3(2y ago)013MITPHPPHP ^8.1

Since Jul 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/albetnov/vuetik-laravel)[ Packagist](https://packagist.org/packages/vuetik/vuetik-laravel)[ Docs](https://github.com/albetnov/vuetik-laravel)[ RSS](/packages/vuetik-vuetik-laravel/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (6)Dependencies (17)Versions (10)Used By (0)

VueTik Laravel
==============

[](#vuetik-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e455f131535db89421648be35b5e6a11ec8751dbd4d64d29dbe41aef788f625c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76756574696b2f76756574696b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vuetik/vuetik-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/7d35713bdc117bf0c65c9c86d27c379fef6c9ca5944308c6a634dadd3df0a311/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6265746e6f762f76756574696b2d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/albetnov/vuetik-laravel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c747ddd49e7d5180e695ade6b5afbc7f39f4c41122c3e4238f4a5b17349bac4d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c6265746e6f762f76756574696b2d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/albetnov/vuetik-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f02eba2dc959dd535697c676a88c0fb262e1522f141c12a45a38cb22d371be8f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76756574696b2f76756574696b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vuetik/vuetik-laravel)

Server Side Integration and Transformers of [Vue-Tik](https://github.com/albetnov/vue-tik) for Laravel.

Migration Guide
---------------

[](#migration-guide)

The migration from 1.x to 2.x is documented in [Migration Guide Wiki](https://github.com/albetnov/vuetik-laravel/wiki/Migrating-from-1.x)

Features
--------

[](#features)

- Image Upload Routing
- Image Cleanup Cron Job
- Automatic base64 image separation and validation to desired object storage
- Twitter Content Pre-Hydration
- Glide Integration
- HTML Sanitation

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

[](#installation)

You can install the package via composer:

```
composer require vuetik/vuetik-laravel
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="vuetik-laravel-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="vuetik-laravel-config"
```

This is the contents of the published config file:

```
[
    'max_upload_size' => 2048,
    'storage' => [
        'disk' => 'local',
        'path' => 'images/',
    ],
    'table' => 'vuetik_images',
    'image_vendor_route' => '/img',
    'glide' => [
        'enable' => true,
        'sign_key' => env('APP_KEY'),
        'img_modifiers' => [],
    ],
    'purge_after' => '-2 days',
    'base64_to_storage' => [
        'enable' => true,
        'save_format' => 'png',
        'quality' => 100
    ],
];
```

Usage
-----

[](#usage)

Vuetik Laravel provides integration for the image upload routes and content parsing. For registering the image upload routes with VueTik requirement, you can easily call:

```
public function boot() {
    Vuetik\VuetikLaravel\VuetikLaravel::routes();
}
```

to any Service Provider.

For parsing content, it can easily be done via:

```
use Vuetik\VuetikLaravel\Facades\VuetikLaravel;

VuetikLaravel::parse($htmlOrDecodedJson);

// or if you use JSON

VuetikLaravel::parseJson($jsonString);
```

> Even though the HTML Parser is working, it is possible the end result is kind of inaccurate. Therefore, using JSON approach is advised.

### Available Options

[](#available-options)

Both the `parse` and `parseJson` API accepts array `$options` which have the following content:

KeyDescriptionTypeDefault Value`twitter.throwOnFail`Set whatever twitter content parsing should throw an exception when fail or just return `Failed Fetching Twitter` paragraph.`bool``true``image.base64_to_disk`Determine if `base64` based image should be moved to disk or not (allow cron cleanup to work either)`bool``config('vuetik-laravel.base64_to_storage.enable')``image.throwOnFail`Set whatever `base64` based image parsing should throw an exception when Vuetik Laravel failed validating it. (ignored if `base64_to_disk` is false)`bool``true``image.saveFormat`Set which format to encode for `base64` image when saved to the disk (ignored if `base64_to_disk` is false)`string``config('vuetik-laravel.base64_to_storage.save_format')``image.disk`Set which driver to use for Vuetik Laravel to save image into.`string``config('vuetik-laravel.storage.disk)``image.quality`Set image quality for `base64` decoding`int``config('vuetik-laravel.base64_to_storage.quality')``image.autoSave`Set the parsed image status to `A``bool``true`Example Passing:

```
use Vuetik\VuetikLaravel\VuetikLaravel;

VuetikLaravel::parseJson($json, [
    'twitter' => [
        'throwOnFail' => true
    ],
    'image' => [
        'throwOnFail' => true
    ]
])
```

Image Management
----------------

[](#image-management)

Each uploaded image is stored with `temporary` state and by default Vuetik Laravel has predefined image management. This behavior can be turned off by setting the `image.autoSave` to `false` (`true` by default).

With that option enabled, Vuetik Laravel will take care of the entire process of image management without needing of manual interactions.

In case you want to perform manual saving, Vuetik Laravel already provided you with helper functions

```
use Vuetik\VuetikLaravel\ImageManager;

// quick store preuploads
// if you have a payload containing predefined id (which usally comes from editor.storage.ids)
// you can use storePreuploads to store the images without Vuetik Laravel to parse it. This could be
// faster, but it's currently unable to save extra attributes (width, height, etc)
ImageManager::storePreuploads(["id1", "id2"]);

// Store all the images parsed from Vuetik Laravel
// This method returns an array containing all the data of the stored image.
// It's expected ContentFactory as the argument (return value of VuetikLaravel::parse() or VuetikLaravel::parseJson())
ImageManager::store($content);

// This method will return a glide url
// based on VuetikImages model with defined base url and additional attributes.
ImageManager::getGlideUrl($imgModel, $vendorUrl, $props);
```

> You usually will the use `Store` API only though.

### Managing failed image parsing

[](#managing-failed-image-parsing)

It is possible; for the image parsing fails to occur, for example invalid string `base64` and so on. Vuetik Laravel already provided you with `image.throwOnFail` which will throw an exception and interrupt the entire parsing process.

This guide will cover if the options are set to false.

- for Base64 images, Vuetik simply ignored them and the resulting image stays as it is.
- for Preupload Images, Vuetik will add a class `vuetik__failed__img` to the parsed content and leave at is. You are encouraged to add a style to highlight the failed images.

> Ultimately, I think it best to leave throwOnFail as true though.

Cleaning up unused image
------------------------

[](#cleaning-up-unused-image)

To clean up an unused image, Vuetik Laravel has provided you with `purge:unused-images` commands which allow you to delete an image created after `vuetik-laravel.purge_after` with `status` of `P`.

Simply schedule the command in `Kernel.php`:

```
protected function schedule(Schedule $schedule): void
{
    $schedule->command('purge:unused-images')->daily();
}
```

The cleanup command also supports the following arguments:

- `--after` override `purge_after` config for the task
- `--disk` override `storage.disk` config for the task
- `--path` override `storage.path` config for the task
- `--show-log` enable verbosity over what going on with the task.

### How is It Work?

[](#how-is-it-work)

Everytime you upload an image or using base64 images, Vuetik Laravel will always keep track of these images and put them into a database, these records have their `created_at` time and a status of either 'P' or 'A.'

And as you already aware Vuetik will only delete images with status of 'P' and `created_at` matches `purge_after` criteria.

Rendering Twitter
-----------------

[](#rendering-twitter)

Vuetik Laravel only pre-hydrated your twitter content, so later it can be used to be parsed and hydrated by the Twitter WidgetJS hence the name `pre-hydrated`.

In order to render twitter in your view, you need to use Twitter JS Dependency to hydrate the content:

```

```

Alternatively if you're using Blade, Vuetik Laravel also provide a helper diretive:

```
@twitterScript
```

Which under the hood renders the script mentioned earlier.

### Managing Failed Twitter Parsing

[](#managing-failed-twitter-parsing)

Twitter parsing may fail due to invalid id. Therefore, the option `twitter.failOnThrow` is existed and `true` by default. In case you set it to `false`, Vuetik Laravel will render: Failed Fetching Twitter paragraph

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.

Credits
-------

[](#credits)

- [Albet Novendo](https://github.com/albetnov)
- [Tiptap PHP](https://github.com/ueberdosis/tiptap-php)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.9% 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 ~85 days

Recently: every ~145 days

Total

8

Last Release

429d ago

Major Versions

1.0.1 → 2.0.0-beta2023-08-06

1.x-dev → 2.0.1-beta2023-08-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7550070?v=4)[albet](/maintainers/albet)[@albet](https://github.com/albet)

---

Top Contributors

[![albetnov](https://avatars.githubusercontent.com/u/76980465?v=4)](https://github.com/albetnov "albetnov (86 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (12 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelvuetikvuetik-laravel

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/vuetik-vuetik-laravel/health.svg)

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

###  Alternatives

[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)

PHPackages © 2026

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