File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 88use Illuminate \Http \JsonResponse ;
99use Illuminate \Http \Request ;
1010
11+ /**
12+ * @template TModel of Model
13+ */
1114trait WithCreateAction
1215{
1316 /**
@@ -80,11 +83,18 @@ protected function createMessages(): array
8083 return [];
8184 }
8285
86+ /**
87+ * @param TModel $model
88+ */
8389 public function creating (Model $ model , array $ data ): array
8490 {
8591 return $ data ;
8692 }
8793
94+ /**
95+ * @param TModel $model
96+ * @return TModel
97+ */
8898 public function created (Model $ model , array $ data ): Model
8999 {
90100 return $ model ;
Original file line number Diff line number Diff line change 88use Illuminate \Http \JsonResponse ;
99use Illuminate \Http \Request ;
1010
11+ /**
12+ * @template TModel of Model
13+ */
1114trait WithEditAction
1215{
1316 /**
@@ -81,11 +84,18 @@ protected function editMessages(): array
8184 return [];
8285 }
8386
87+ /**
88+ * @param TModel $model
89+ */
8490 public function updating (Model $ model , array $ data ): array
8591 {
8692 return $ data ;
8793 }
8894
95+ /**
96+ * @param TModel $model
97+ * @return TModel
98+ */
8999 public function updated (Model $ model , array $ data ): Model
90100 {
91101 return $ model ;
Original file line number Diff line number Diff line change 99use Illuminate \Http \JsonResponse ;
1010use Illuminate \Http \Request ;
1111
12+ /**
13+ * @template TModel of Model
14+ */
1215trait WithRemoveAction
1316{
1417 /**
@@ -83,11 +86,18 @@ protected function removeMessages(): array
8386 return [];
8487 }
8588
89+ /**
90+ * @param TModel $model
91+ */
8692 public function deleting (Model $ model , array $ data ): array
8793 {
8894 return $ data ;
8995 }
9096
97+ /**
98+ * @param TModel $model
99+ * @return TModel
100+ */
91101 public function deleted (Model $ model , array $ data ): Model
92102 {
93103 return $ model ;
Original file line number Diff line number Diff line change 1818 */
1919abstract class DataTablesEditor
2020{
21+ /** @use \Yajra\DataTables\Concerns\WithCreateAction<TModel> */
2122 use Concerns \WithCreateAction;
23+
24+ /** @use \Yajra\DataTables\Concerns\WithEditAction<TModel> */
2225 use Concerns \WithEditAction;
26+
2327 use Concerns \WithForceDeleteAction;
28+
29+ /** @use \Yajra\DataTables\Concerns\WithRemoveAction<TModel> */
2430 use Concerns \WithRemoveAction;
2531 use Concerns \WithRestoreAction;
2632 use Concerns \WithUploadAction;
You can’t perform that action at this time.
0 commit comments