9
9
10
10
use App \Actions \Traits \WithActionUpdate ;
11
11
use App \Http \Resources \Catalogue \DepartmentResource ;
12
+ use App \Models \Catalogue \ProductCategory ;
12
13
use App \Models \Market \ShopProductCategory ;
13
14
use Lorisleiva \Actions \ActionRequest ;
14
15
@@ -19,7 +20,7 @@ class UpdateProductCategory
19
20
20
21
private bool $ asAction =false ;
21
22
22
- public function handle (ShopProductCategory $ productCategory , array $ modelData ): ShopProductCategory
23
+ public function handle (ProductCategory $ productCategory , array $ modelData ): ProductCategory
23
24
{
24
25
$ productCategory = $ this ->update ($ productCategory , $ modelData , ['data ' ]);
25
26
//ProductCategoryHydrateUniversalSearch::dispatch($productCategory);
@@ -47,21 +48,21 @@ public function rules(): array
47
48
];
48
49
}
49
50
50
- public function action (ShopProductCategory $ productCategory , array $ objectData ): ShopProductCategory
51
+ public function action (ProductCategory $ productCategory , array $ objectData ): ProductCategory
51
52
{
52
53
$ this ->asAction =true ;
53
54
$ this ->setRawAttributes ($ objectData );
54
55
$ validatedData = $ this ->validateAttributes ();
55
56
return $ this ->handle ($ productCategory , $ validatedData );
56
57
}
57
58
58
- public function asController (ShopProductCategory $ productCategory , ActionRequest $ request ): ShopProductCategory
59
+ public function asController (ProductCategory $ productCategory , ActionRequest $ request ): ProductCategory
59
60
{
60
61
$ productCategory = $ productCategory ::where ('slug ' , $ request ->route ()->parameters )->first ();
61
62
return $ this ->handle ($ productCategory , $ request ->all ());
62
63
}
63
64
64
- public function jsonResponse (ShopProductCategory $ productCategory ): DepartmentResource
65
+ public function jsonResponse (ProductCategory $ productCategory ): DepartmentResource
65
66
{
66
67
return new DepartmentResource ($ productCategory );
67
68
}
0 commit comments