Skip to content

Dropzone uploading in demo - generalize the denial #527

@tabacitu

Description

@tabacitu

We talked about making the Dropzone operation not work... in a more general way. So that people using the Demo in production don't have access to upload stuff. Pedro came up with this - sounds good to me!

<?php

namespace App\Http\Controllers\Operations;

if (! env('APP_ENV') === 'production') {
    trait DropzoneOperation
    {
        public function dropzoneUpload()
        {
            return response()->json([]);
        }
    }
} else {
    trait DropzoneOperation
    {
        use \Backpack\Pro\Http\Controllers\Operations\DropzoneOperation;
    }
}

And then in demo we use App\Http\Controllers\Operations\DropzoneOperation instead of the one in the package ?

If you agree I can push this change.

Cheers

Originally posted by @pxpm in #456 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions