@@ -32,7 +32,7 @@ public function index(Request $request, $object_type, $id) : JsonResponse | arra
3232 {
3333
3434 // Check the permissions to make sure the user can view the object
35- $ object = self ::$ map_object_type [$ object_type ]::find ($ id );
35+ $ object = self ::$ map_object_type [$ object_type ]::withTrashed ()-> find ($ id );
3636 $ this ->authorize ('view ' , $ object );
3737
3838 if (!$ object ) {
@@ -96,7 +96,7 @@ public function store(UploadFileRequest $request, $object_type, $id) : JsonRespo
9696 {
9797
9898 // Check the permissions to make sure the user can view the object
99- $ object = self ::$ map_object_type [$ object_type ]::find ($ id );
99+ $ object = self ::$ map_object_type [$ object_type ]::withTrashed ()-> find ($ id );
100100 $ this ->authorize ('view ' , $ object );
101101
102102 if (!$ object ) {
@@ -144,7 +144,7 @@ public function store(UploadFileRequest $request, $object_type, $id) : JsonRespo
144144 public function show ($ object_type , $ id , $ file_id ) : JsonResponse | StreamedResponse | Storage | StorageHelper | BinaryFileResponse
145145 {
146146 // Check the permissions to make sure the user can view the object
147- $ object = self ::$ map_object_type [$ object_type ]::find ($ id );
147+ $ object = self ::$ map_object_type [$ object_type ]::withTrashed ()-> find ($ id );
148148 $ this ->authorize ('view ' , $ object );
149149
150150 if (!$ object ) {
@@ -188,7 +188,7 @@ public function destroy($object_type, $id, $file_id) : JsonResponse
188188 {
189189
190190 // Check the permissions to make sure the user can view the object
191- $ object = self ::$ map_object_type [$ object_type ]::find ($ id );
191+ $ object = self ::$ map_object_type [$ object_type ]::withTrashed ()-> find ($ id );
192192 $ this ->authorize ('update ' , self ::$ map_object_type [$ object_type ]);
193193
194194 if (!$ object ) {
0 commit comments