6
6
use Modules \Base \Classes \Migration ;
7
7
use Modules \Base \Entities \BaseModel ;
8
8
9
+ use Modules \Core \Classes \Views \ListTable ;
10
+ use Modules \Core \Classes \Views \FormBuilder ;
11
+
9
12
class Package extends BaseModel
10
13
{
11
14
@@ -17,6 +20,59 @@ class Package extends BaseModel
17
20
public $ migrationDependancy = ['isp_billing_cycle ' ];
18
21
protected $ table = "isp_package " ;
19
22
23
+
24
+ public function listTable (){
25
+ // listing view fields
26
+ $ fields = new ListTable ();
27
+
28
+ $ fields ->name ('title ' )->type ('text ' )->ordering (true );
29
+ $ fields ->name ('slug ' )->type ('text ' )->ordering (true );
30
+ $ fields ->name ('pool ' )->type ('text ' )->ordering (true );
31
+ $ fields ->name ('billing_cycle_id ' )->type ('recordpicker ' )->table ('isp_billing_cycle ' )->ordering (true );
32
+ $ fields ->name ('gateway_id ' )->type ('recordpicker ' )->table ('isp_gateway ' )->ordering (true );
33
+ $ fields ->name ('speed ' )->type ('text ' )->ordering (true );
34
+ $ fields ->name ('speed_type ' )->type ('text ' )->ordering (true );
35
+ $ fields ->name ('bundle ' )->type ('text ' )->ordering (true );
36
+ $ fields ->name ('bundle_type ' )->type ('text ' )->ordering (true );
37
+ $ fields ->name ('published ' )->type ('switch ' )->ordering (true );
38
+
39
+ return $ fields ;
40
+
41
+ }
42
+
43
+ public function formBuilder (){
44
+ // listing view fields
45
+ $ fields = new FormBuilder ();
46
+
47
+ $ fields ->name ('title ' )->type ('text ' )->group ('w-1/2 ' );
48
+ $ fields ->name ('slug ' )->type ('text ' )->group ('w-1/2 ' );
49
+ $ fields ->name ('pool ' )->type ('text ' )->group ('w-1/2 ' );
50
+ $ fields ->name ('billing_cycle_id ' )->type ('recordpicker ' )->table ('isp_billing_cycle ' )->group ('w-1/2 ' );
51
+ $ fields ->name ('gateway_id ' )->type ('recordpicker ' )->table ('isp_gateway ' )->group ('w-1/2 ' );
52
+ $ fields ->name ('speed ' )->type ('text ' )->group ('w-1/2 ' );
53
+ $ fields ->name ('speed_type ' )->type ('text ' )->group ('w-1/2 ' );
54
+ $ fields ->name ('bundle ' )->type ('text ' )->group ('w-1/2 ' );
55
+ $ fields ->name ('bundle_type ' )->type ('text ' )->group ('w-1/2 ' );
56
+ $ fields ->name ('published ' )->type ('switch ' )->group ('w-1/2 ' );
57
+ $ fields ->name ('description ' )->type ('textarea ' )->group ('w-full ' );
58
+
59
+ return $ fields ;
60
+
61
+ }
62
+
63
+ public function filter (){
64
+ // listing view fields
65
+ $ fields = new FormBuilder ();
66
+
67
+ $ fields ->name ('title ' )->type ('text ' )->group ('w-1/6 ' );
68
+ $ fields ->name ('slug ' )->type ('text ' )->group ('w-1/6 ' );
69
+ $ fields ->name ('pool ' )->type ('text ' )->group ('w-1/6 ' );
70
+ $ fields ->name ('billing_cycle_id ' )->type ('recordpicker ' )->table ('isp_billing_cycle ' )->group ('w-1/6 ' );
71
+ $ fields ->name ('gateway_id ' )->type ('recordpicker ' )->table ('isp_gateway ' )->group ('w-1/6 ' );
72
+
73
+ return $ fields ;
74
+
75
+ }
20
76
/**
21
77
* List of fields for managing postings.
22
78
*
0 commit comments