@@ -55,7 +55,7 @@ class Builder
5555 * @param Factory $view
5656 * @param HtmlBuilder $html
5757 */
58- public function __construct (protected Repository $ config , protected Factory $ view , protected HtmlBuilder $ html )
58+ public function __construct (public Repository $ config , public Factory $ view , public HtmlBuilder $ html )
5959 {
6060 /** @var array $defaults */
6161 $ defaults = $ this ->config ->get ('datatables-html.table ' , []);
@@ -74,28 +74,26 @@ public function __construct(protected Repository $config, protected Factory $vie
7474 * @param string|null $script
7575 * @param array $attributes
7676 * @return \Illuminate\Support\HtmlString
77- * @throws \Exception
7877 */
7978 public function scripts (string $ script = null , array $ attributes = ['type ' => 'text/javascript ' ]): HtmlString
8079 {
8180 $ script = $ script ?: $ this ->generateScripts ();
8281 $ attributes = $ this ->html ->attributes ($ attributes );
8382
84- return new HtmlString ("<script {$ attributes }> { $ script} </script> \n " );
83+ return new HtmlString ("<script {$ attributes }> $ script</script> " );
8584 }
8685
8786 /**
8887 * Get generated raw scripts.
8988 *
9089 * @return \Illuminate\Support\HtmlString
91- * @throws \Exception
9290 */
9391 public function generateScripts (): HtmlString
9492 {
9593 $ parameters = $ this ->generateJson ();
9694
9795 return new HtmlString (
98- sprintf ($ this ->template (), $ this ->getTableAttribute ('id ' ), $ parameters )
96+ trim ( sprintf ($ this ->template (), $ this ->getTableAttribute ('id ' ), $ parameters) )
9997 );
10098 }
10199
@@ -172,7 +170,7 @@ public function table(array $attributes = [], bool $drawFooter = false, bool $dr
172170 $ th = $ this ->compileTableHeaders ();
173171 $ htmlAttr = $ this ->html ->attributes ($ this ->tableAttributes );
174172
175- $ tableHtml = '<table ' .$ htmlAttr .'> ' ;
173+ $ tableHtml = '<table ' .$ htmlAttr .'> ' ;
176174 $ searchHtml = $ drawSearch ? '<tr class="search-filter"> ' .implode ('' ,
177175 $ this ->compileTableSearchHeaders ()).'</tr> ' : '' ;
178176 $ tableHtml .= '<thead><tr> ' .implode ('' , $ th ).'</tr> ' .$ searchHtml .'</thead> ' ;
0 commit comments