You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If someone wants to add custom slug_normalizer
Example :
class CustomMarkdownNormalizer implements TextNormalizerInterface
{
use Resumeable;
public function normalize(string $text, $context = null): string
{
// Use Laravel's Str::slug function
return Str::slug($text);
}
}
As closure in config file give error during php artisan config:cache
So use following trait to use with custom class:
<?php
trait Resumeable
{
public static function __set_state(array $state_array): static
{
$object = new static();
foreach ($state_array as $prop => $state) {
if (!property_exists($object, $prop)) continue;
$object->{$prop} = $state;
}
return $object;
}
}
If someone wants to add custom
slug_normalizer
Example :
As closure in config file give error during
php artisan config:cache
So use following trait to use with custom class:
Source spatie/laravel-markdown#33 (reply in thread)
The text was updated successfully, but these errors were encountered: