devianl2 / laravel-scorm

Laravel scorm package
MIT License
38 stars 20 forks source link

Issue while importing SCORM package #17

Closed rhnkyr closed 2 years ago

rhnkyr commented 2 years ago

My import code is

public function import(Request $request)
    {
        try {
            $scorm = $this->scormManager->uploadScormArchive($request->file('file'));
            // handle scorm runtime error msg
        } catch (InvalidScormArchiveException $ex) {
            return $ex->getMessage();
        }

        // response helper function from base controller reponse json.
        return $this->respond(ScormModel::with('scos')->whereUuid($scorm['uuid'])->first());
    }

my config (scorm.php)

return [

    'table_names' =>  [
        'user_table'   =>  'users',
        'scorm_table'   =>  'scorm',
        'scorm_sco_table'   =>  'scorm_sco',
        'scorm_sco_tracking_table'   =>  'scorm_sco_tracking',
    ],
    // Scorm directory. You may create a custom path in file system
    'disk'  =>  'local',//TODO: change to s3 later
];

filesystem.php contains default local disk props. After submitting I got this error message

BadMethodCallException
Call to undefined method League\Flysystem\Filesystem::createDirectory

src/Manager/ScormDisk.php L:34

Did I miss something?

CThomas87 commented 2 years ago

What versions of Laravel / Flysystem are you running?

devianl2 commented 2 years ago

What versions of Laravel / Flysystem are you running?

Laravel 9 Flysystem 2.0

startly commented 2 years ago

I have a same and If i change createDirectory by makeDirectory, it's work Capture d’écran de 2022-06-07 16-19-47

devianl2 commented 2 years ago

createDirectory

Hi @startly , this library is using flysystem v2 to fit some cloud storage libraries.

Try to upgrade flysystem from v1 to v2 by adding line below into your composer.json

"league/flysystem-bundle": "^2.2",

rhnkyr commented 2 years ago

It was because of laravel version. Now using 3.0.4 and all is good.