@@ -48,7 +48,7 @@ public function handle()
48
48
$ dom = config ('datatables-buttons.generator.dom ' , 'Bfrtip ' );
49
49
50
50
$ this ->call ('datatables:html ' , [
51
- 'name ' => $ this ->prepareHtmlBuilderName ( $ this -> getNameInput () ),
51
+ 'name ' => $ this ->getDataTableBaseName ( ),
52
52
'--columns ' => $ this ->option ('columns ' ) ?: $ columns ,
53
53
'--buttons ' => $ this ->option ('buttons ' ) ?: $ buttons ,
54
54
'--dom ' => $ this ->option ('dom ' ) ?: $ dom ,
@@ -65,7 +65,7 @@ public function handle()
65
65
*
66
66
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
67
67
*/
68
- protected function buildClass ($ name )
68
+ protected function buildClass ($ name ): string
69
69
{
70
70
$ stub = parent ::buildClass ($ name );
71
71
@@ -83,13 +83,13 @@ protected function buildClass($name)
83
83
}
84
84
85
85
/**
86
- * Prepare html builder name from input .
86
+ * Get DataTable class base name without the suffix .
87
87
*
88
88
* @return string
89
89
*/
90
- protected function prepareHtmlBuilderName (): string
90
+ protected function getDataTableBaseName (): string
91
91
{
92
- return preg_replace ('#datatable$#i ' , '' , $ this ->getNameInput ());
92
+ return ( string ) preg_replace ('#datatable$#i ' , '' , $ this ->getNameInput ());
93
93
}
94
94
95
95
/**
@@ -99,7 +99,7 @@ protected function prepareHtmlBuilderName(): string
99
99
*/
100
100
protected function prepareModelName (): string
101
101
{
102
- return basename (preg_replace ( ' #datatable$#i ' , '' , $ this ->getNameInput () ));
102
+ return basename ($ this ->getDataTableBaseName ( ));
103
103
}
104
104
105
105
/**
0 commit comments