Skip to content

Publit.io filesystem adapter for Flysystem.

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

tanercc/flysystem-publitio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cdd04a0 · Feb 28, 2024

History

3 Commits
Feb 28, 2024
Feb 28, 2024
Feb 28, 2024
Jun 16, 2022
Feb 28, 2024
Feb 28, 2024
Feb 28, 2024

Repository files navigation

Flysystem adapter for the Publitio API

This package contains a Flysystem adapter for Publitio.

Installation

TODO

Usage

<?php

namespace App\Providers;

use Illuminate\Support\Facades\Storage;
use League\Flysystem\Filesystem;
use Illuminate\Support\ServiceProvider;
use Publitio\API;
use Publitio\FlysystemPublitio\PublitioAdapter;

class PublitioServiceProvider extends ServiceProvider
{
    /**
     * Register bindings in the container.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Storage::extend('publitio', function ($app, $config) {

            $client = new API($config['api_key'], $config['api_secret']);
            $adapter = new PublitioAdapter($client, $config);

            return new Filesystem($adapter);
        });
    }
}

add config > filesystems.php

    'disks' => [
        ...
        'publitio' => [
            'driver' => 'publitio',
            'api_key' => env('PUBLITIO_API_KEY', 'JbodQdBHSNvpix0yJAxN'),
            'api_secret' => env('PUBLITIO_API_SECRET', 'NPkny339LvH1txSnbQPjMPHMmAhAwLby'),
            'domain' => env('PUBLITIO_DOMAIN', 'https://media.publit.io'),
        ],

add config > app.php

        App\Providers\PublitioServiceProvider::class,

Changelog

Please see CHANGELOG for more information what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

About

Publit.io filesystem adapter for Flysystem.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages