Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Xcallibur's avatar

Laravel 9 / Flysystem 3 put / write error

Hey,

We updated our application to Laravel 9 with Flysystem 3.

In our code we create a new file via:

Storage::disk('concepts')->put($concept->id.'.docx', file_get_contents($tmpPath));

After the update this gives the following error:

Call to undefined method League\Flysystem\Filesystem::put()

The flysystem update guide says that put() is changed to write().

But in the storage facade they still use put like our code. Also the laraval 9 documentation suggest to use put. https://laravel.com/docs/9.x/filesystem#the-local-driver

How can we fix this error?

Thanks

0 likes
19 replies
Sinnbeck's avatar

Or can you share the error from ignition?

Xcallibur's avatar

Thanks for your response.

Yes we use:

    "league/flysystem": "^3.0",
    "laravel/framework": "^9.0",

What is ignition?

Xcallibur's avatar

@Sinnbeck In config/filesystems.php the config for de concepts disk is:

        'concepts' => [
            'driver' => 'webdav',
            'baseUri' => env('KICS_WEBDAV_BASE_URL', 'http://url.test'),
        ],

We use webdav. But in the webdav project we dont use flysystem.

We use the package:

        "league/flysystem-webdav": "^3.0",
Sinnbeck's avatar

@Xcallibur and how have you added that? I assume you extend storage in a service provider?

Xcallibur's avatar

@Sinnbeck app/Providers/WebDavServiceProvider.php

<?php

declare(strict_types = 1);

namespace App\Providers;

use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use League\Flysystem\WebDAV\WebDAVAdapter;
use Sabre\DAV\Client;

class WebDavServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Storage::extend('webdav', function ($app, $config) {
            $client = new Client($config);

            return new Filesystem(new WebDAVAdapter($client));
        });
    }

    public function register()
    {
    }
}
Xcallibur's avatar

config/app.php

In the providers array we add

        App\Providers\WebDavServiceProvider::class,
Xcallibur's avatar

@Sinnbeck So the code should be like this. Right?

<?php

declare(strict_types = 1);

namespace App\Providers;

use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use League\Flysystem\WebDAV\WebDAVAdapter;
use Sabre\DAV\Client;

class WebDavServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Storage::extend('webdav', function ($app, $config) {
            $adapter = new WebDAVAdapter(
                new Client($config)
            );

            return new FilesystemAdapter(
                new Filesystem($adapter, $config),
                $adapter,
                $config
            );
        });
    }

    public function register()
    {
    }
}
Sinnbeck's avatar

If the issue is solved please mark the answer that helped you as best, to set the thread as solved

Please or to participate in this conversation.