Merge pull request #6133 from jitendra-webkul/master

Issue #6132 fixed
This commit is contained in:
Jitendra Singh 2022-03-25 16:14:19 +05:30 committed by GitHub
commit f9bb67fe4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -286,7 +286,7 @@ abstract class DataGrid
$this->checkPermissions($action, $specialPermission, function ($action, $eventName) {
$this->fireEvent('action.before.' . $eventName);
$action['key'] = Str::slug($action['title'], '_');
$action['key'] = Str::slug($action['title'], '_', app()->getLocale());
$this->actions[] = $action;
$this->enableAction = true;

View File

@ -275,6 +275,7 @@ trait ProvideCollection
if ($toDisplay) {
$urlKey = $this->generateKeyFromActionTitle($action['title'], '_url');
$record->$urlKey = route($action['route'], $record->{$action['index'] ?? $this->index});
}
}
@ -306,7 +307,7 @@ trait ProvideCollection
*/
private function generateKeyFromActionTitle($title, $suffix)
{
$validatedStrings = Str::slug($title, '_');
$validatedStrings = Str::slug($title, '_', app()->getLocale());
return strtolower($validatedStrings) . $suffix;
}