1. Go to this page and download the library: Download stamat/tailwind-merge-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Extend / override the default config (same semantics as extendTailwindMerge in JS)
$tw = TailwindMerge::create([
'cacheSize' => 1000,
'prefix' => 'tw', // for Tailwind's `tw:` prefix option
'extend' => [
'theme' => ['spacing' => ['my-space']],
'classGroups' => ['shadow' => ['shadow-100', 'shadow-200']],
],
'override' => [ /* replaces instead of appends */ ],
]);
// Or a fully custom config (see DefaultConfig::config() for the shape)
$tw = new TailwindMerge($fullConfig);
use Stamat\TailwindMerge\Laravel\Facades\TwMerge;
use Stamat\TailwindMerge\TailwindMerge;
TwMerge::merge('px-2 p-4', 'bg-red'); // facade
app(TailwindMerge::class)->merge(...); // or resolve from the container
sh
php artisan vendor:publish --tag=tailwind-merge
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.