Laravel-Backpack / demo

A working demo of Laravel with all Backpack packages installed.
http://backpackforlaravel.com
Other
329 stars 165 forks source link

Dropzone uploading in demo - generalize the denial #527

Open tabacitu opened 1 year ago

tabacitu commented 1 year ago

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 https://github.com/Laravel-Backpack/demo/pull/456#discussion_r1245146595_