first commit

This commit is contained in:
tanch0
2024-06-10 18:06:58 +05:45
commit c569ea1d0c
1953 changed files with 85451 additions and 0 deletions

View File

@ -0,0 +1,21 @@
<?php
namespace App\Providers;
use Illuminate\Support\Str;
class ShortcodeProcessor
{
public function process($content)
{
return preg_replace_callback('/\[([\w_]+)([^\]]*)\]/', function ($matches) {
$shortcodeName = $matches[1];
$shortcodeAttributes = Str::of($matches[2])->trim()->replace("'", "\"")->__toString();
return "@shortcode('$shortcodeName', $shortcodeAttributes)";
}, $content);
}
public function processShortcodes($content)
{
return $this->process($content);
}
}