@@ -48,7 +48,7 @@ public function handle()
4848 $ dom = config ('datatables-buttons.generator.dom ' , 'Bfrtip ' );
4949
5050 $ this ->call ('datatables:html ' , [
51- 'name ' => $ this ->prepareHtmlBuilderName ( $ this -> getNameInput () ),
51+ 'name ' => $ this ->getDataTableBaseName ( ),
5252 '--columns ' => $ this ->option ('columns ' ) ?: $ columns ,
5353 '--buttons ' => $ this ->option ('buttons ' ) ?: $ buttons ,
5454 '--dom ' => $ this ->option ('dom ' ) ?: $ dom ,
@@ -65,7 +65,7 @@ public function handle()
6565 *
6666 * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
6767 */
68- protected function buildClass ($ name )
68+ protected function buildClass ($ name ): string
6969 {
7070 $ stub = parent ::buildClass ($ name );
7171
@@ -83,13 +83,13 @@ protected function buildClass($name)
8383 }
8484
8585 /**
86- * Prepare html builder name from input .
86+ * Get DataTable class base name without the suffix .
8787 *
8888 * @return string
8989 */
90- protected function prepareHtmlBuilderName (): string
90+ protected function getDataTableBaseName (): string
9191 {
92- return preg_replace ('#datatable$#i ' , '' , $ this ->getNameInput ());
92+ return ( string ) preg_replace ('#datatable$#i ' , '' , $ this ->getNameInput ());
9393 }
9494
9595 /**
@@ -99,7 +99,7 @@ protected function prepareHtmlBuilderName(): string
9999 */
100100 protected function prepareModelName (): string
101101 {
102- return basename (preg_replace ( ' #datatable$#i ' , '' , $ this ->getNameInput () ));
102+ return basename ($ this ->getDataTableBaseName ( ));
103103 }
104104
105105 /**
0 commit comments