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
The current Slug field is still empty after entering the Chinese title, and it needs to be manually entered to save it.
My idea is: Either change the Slug in the blueprint field configuration so that its value can be empty, or use Laravel Str::slug($title,'zh') to convert, zh can be to read the configuration file: config( 'app.locale').
The blueprint configuration can be left blank, then I will listen to the save event: EntrySaving detects whether the slug field is empty when the event is saved, and then saves this value according to my idea.
However, the default Slug field of the current blueprint field cannot be changed to a null value, and the current idea cannot be realized.
<?phpnamespaceApp\Providers;
useIlluminate\Foundation\Support\Providers\EventServiceProviderasServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/** * The event listener mappings for the application. * * @var array */protected$listen = [
\Statamic\Events\EntrySaving::class => [
\App\Listeners\TranslateEntitySlug::class,
]
];
}
The current Slug field is still empty after entering the Chinese title, and it needs to be manually entered to save it.
My idea is: Either change the Slug in the blueprint field configuration so that its value can be empty, or use Laravel Str::slug($title,'zh') to convert, zh can be to read the configuration file: config( 'app.locale').
The blueprint configuration can be left blank, then I will listen to the save event: EntrySaving detects whether the slug field is empty when the event is saved, and then saves this value according to my idea.
However, the default Slug field of the current blueprint field cannot be changed to a null value, and the current idea cannot be realized.
The text was updated successfully, but these errors were encountered: