Skip to content

Commit

Permalink
🐛 Fix generate slug utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
juzaweb committed Mar 19, 2023
1 parent 4a71454 commit ef333de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion modules/CMS/Traits/UseSlug.php
Expand Up @@ -52,7 +52,7 @@ public function generateSlug($string = null): string
}
}

$baseSlug = substr($string, 0, 70);
$baseSlug = sub_char($string, 70, '');
$baseSlug = Str::slug($baseSlug);

$i = 1;
Expand Down
22 changes: 12 additions & 10 deletions modules/DevTool/stubs/plugin/resource/controller.stub
Expand Up @@ -5,35 +5,37 @@ namespace $CLASS_NAMESPACE$;
use Juzaweb\CMS\Traits\ResourceController;
use Illuminate\Support\Facades\Validator;
use Juzaweb\CMS\Http\Controllers\BackendController;
use Juzaweb\CMS\Abstracts\DataTable;
use $MODULE_NAMESPACE$Http\Datatables\$DATATABLE$;
use $MODULE_NAMESPACE$Models\$MODEL_NAME$;

class $CLASS$ extends BackendController
{
use ResourceController;

protected $viewPrefix = '$MODULE_DOMAIN$::backend.$VIEW_NAME$';
protected string $viewPrefix = '$MODULE_DOMAIN$::backend.$VIEW_NAME$';

protected function getDataTable()
protected function getDataTable(...$params): DataTable
{
return new $DATATABLE$();
}

protected function validator(array $attributes)
protected function validator(array $attributes, ...$params): \Illuminate\Contracts\Validation\Validator
{
$validator = Validator::make($attributes, [
// Rules
]);

return $validator;
return Validator::make(
$attributes,
[
// Rules
]
);
}

protected function getModel()
protected function getModel(...$params): string
{
return $MODEL_NAME$::class;
}

protected function getTitle()
protected function getTitle(...$params): string
{
return trans('$MODULE_DOMAIN$::content.$TABLE_NAME$');
}
Expand Down

0 comments on commit ef333de

Please sign in to comment.