File tree Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 18
18
"require" : {
19
19
"php" : " ^8.1" ,
20
20
"ext-json" : " *" ,
21
- "yajra/laravel-datatables-oracle" : " ^10.0" ,
22
- "laravelcollective/html" : " ^6.3.0"
21
+ "yajra/laravel-datatables-oracle" : " ^10.0"
23
22
},
24
23
"require-dev" : {
25
24
"nunomaduro/larastan" : " ^2.4" ,
Original file line number Diff line number Diff line change 2
2
3
3
namespace Yajra \DataTables \Html ;
4
4
5
- use Collective \Html \HtmlBuilder ;
5
+ use Yajra \ DataTables \Html \HtmlBuilder ;
6
6
use Illuminate \Contracts \Config \Repository ;
7
7
use Illuminate \Contracts \View \Factory ;
8
8
use Illuminate \Support \Collection ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Yajra \DataTables \Html ;
4
+
5
+ class HtmlBuilder
6
+ {
7
+ public function attributes (array $ attributes ): string
8
+ {
9
+ $ html = [];
10
+ foreach ($ attributes as $ key => $ value ) {
11
+ $ element = $ this ->attributeElement ($ key , $ value );
12
+ if (! is_null ($ element )) {
13
+ $ html [] = $ element ;
14
+ }
15
+ }
16
+
17
+ return count ($ html ) > 0 ? ' ' .implode (' ' , $ html ) : '' ;
18
+ }
19
+
20
+ private function attributeElement (int |string $ key , mixed $ value ): ?string
21
+ {
22
+ if (is_numeric ($ key )) {
23
+ $ key = $ value ;
24
+ }
25
+
26
+ if (! is_null ($ value )) {
27
+ return $ key .'=" ' .e ($ value ).'" ' ;
28
+ }
29
+
30
+ return null ;
31
+ }
32
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace Yajra \DataTables ;
4
4
5
- use Collective \Html \HtmlServiceProvider as CollectiveHtml ;
6
5
use Illuminate \Support \ServiceProvider ;
7
6
8
7
class HtmlServiceProvider extends ServiceProvider
@@ -41,8 +40,6 @@ public function register(): void
41
40
{
42
41
$ this ->mergeConfigFrom (__DIR__ .'/resources/config/config.php ' , 'datatables-html ' );
43
42
44
- $ this ->app ->register (CollectiveHtml::class);
45
-
46
43
$ this ->app ->bind ('datatables.html ' , function () {
47
44
return $ this ->app ->make (Html \Builder::class);
48
45
});
You can’t perform that action at this time.
0 commit comments