jeudi 25 octobre 2018

laravel5 create custom disk for uploading photo

I'm using laravel 5.6 and i wanted to create my custom disk for uploading images

and i received this error

InvalidArgumentException Driver [] is not supported.

this is how i save file in controller

    $cover = $request->file('cover_image');
    $extension = $cover->getClientOriginalExtension();
    Storage::disk('test')->put($cover->getFilename().'.'.$extension,  File::get($cover));

this is my config/filesystems.php

   'disks' => [

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],

    'test' => [
        'driver' => 'local',
        'root' => storage_path(),
    ],

    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public/asghar'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    's3' => [
        'driver' => 's3',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
        'bucket' => env('AWS_BUCKET'),
        'url' => env('AWS_URL'),
    ], 



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire