Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/Http/Controllers/Api/UploadedFilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function index(Request $request, $object_type, $id) : JsonResponse | arra
{

// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::find($id);
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$this->authorize('view', $object);

if (!$object) {
Expand Down Expand Up @@ -96,7 +96,7 @@ public function store(UploadFileRequest $request, $object_type, $id) : JsonRespo
{

// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::find($id);
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$this->authorize('view', $object);

if (!$object) {
Expand Down Expand Up @@ -144,7 +144,7 @@ public function store(UploadFileRequest $request, $object_type, $id) : JsonRespo
public function show($object_type, $id, $file_id) : JsonResponse | StreamedResponse | Storage | StorageHelper | BinaryFileResponse
{
// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::find($id);
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$this->authorize('view', $object);

if (!$object) {
Expand Down Expand Up @@ -188,7 +188,7 @@ public function destroy($object_type, $id, $file_id) : JsonResponse
{

// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::find($id);
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$this->authorize('update', self::$map_object_type[$object_type]);

if (!$object) {
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/UploadedFilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function store(UploadFileRequest $request, $object_type, $id) : RedirectR
{

// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::find($id);
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$this->authorize('update', $object);

if (!$object) {
Expand Down Expand Up @@ -85,7 +85,7 @@ public function store(UploadFileRequest $request, $object_type, $id) : RedirectR
public function show($object_type, $id, $file_id) : RedirectResponse | StreamedResponse | Storage | StorageHelper | BinaryFileResponse
{
// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::find($id);
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$this->authorize('view', $object);

if (!$object) {
Expand Down Expand Up @@ -130,7 +130,7 @@ public function destroy($object_type, $id, $file_id) : RedirectResponse
{

// Check the permissions to make sure the user can view the object
$object = self::$map_object_type[$object_type]::find($id);
$object = self::$map_object_type[$object_type]::withTrashed()->find($id);
$this->authorize('update', self::$map_object_type[$object_type]);

if (!$object) {
Expand Down
Loading