2017-11-01 3 views
0

Ich habe mehrere Threads mit diesem Fehler gesehen, aber nicht von ihnen sind die richtige Lösung für mich.InvalidArgumentException in FilesystemManager.php Zeile 121: Treiber [] wird nicht unterstützt

immer diese Fehlermeldung, wenn ich versuche, einen Eintrag in meinen Laravel Rucksack CRUD Tabellen zu löschen:

InvalidArgumentException in FilesystemManager.php Linie 121: Driver [] werden nicht unterstützt.

Erraten, es hat etwas mit meinem filesystems.php

'disks' => [ 

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

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

    's3' => [ 
     'driver' => 's3', 
     'key' => env('AWS_KEY'), 
     'secret' => env('AWS_SECRET'), 
     'region' => env('AWS_REGION'), 
     'bucket' => env('AWS_BUCKET'), 
    ], 

    'uploads' => [ 
     'driver' => 'local', 
     'root' => public_path('uploads'), 
    ], 

    ... 

    'hero' => [ 
     'driver' => 'local', 
     'root' => storage_path('app/content/img/heroes/'), 
    ], 

    ... 

Oder mein Modell

<?php 

namespace App\Models; 

use Illuminate\Database\Eloquent\Model; 
use Backpack\CRUD\CrudTrait; 
use Glide; 

class HeroImages extends Model { 
use CrudTrait; 

protected $primaryKey = 'id'; 
protected $fillable = [ 
    'hero_id', 
    'image', 
    'title', 
    'sub_title', 
    'link_label', 
    'link_value', 
    'order', 
    'status', 
]; 

protected $table = "hero_images"; 

/* 
* ADMIN: Store image on server 
*/ 
public function setImageAttribute($value) 
{ 
    $attribute_name = "image"; 
    $disk = "hero"; 
    $destination_path = ""; 

    // if the image was erased 
    if ($value==null) { 
     // delete the image from disk 
     \Storage::disk($disk)->delete($this->{$attribute_name}); 

     // set null in the database column 
     $this->attributes[$attribute_name] = null; 
    } 

    // if a base64 was sent, store it in the db 
    if (starts_with($value, 'data:image')) 
    { 
     // 0. Make the image 
     $image = \Image::make($value); 
     // 1. Generate a filename. 
     $filename = md5($value.time()).'.jpg'; 
     // 2. Store the image on disk. 
     \Storage::disk($disk)->put($destination_path.'/'.$filename, $image->stream()); 
     // 3. Save the path to the database 
     $this->attributes[$attribute_name] = $destination_path.'/'.$filename; 
    } 
} 

/* 
* ADMIN: Delete image from database (https://laravel-backpack.readme.io/v3.0/docs/crud-fields#section-image) 
*/ 
public static function boot() 
{ 
    parent::boot(); 
    static::deleting(function($obj) { 
     \Storage::disk('public_folder')->delete($obj->image); 
    }); 
} 

}

Antwort

0

Nevermind zu tun, ich sah nur den Fehler als ich meinen Code gepostet habe. In

public_folder war nicht das richtige Attribut, ich brauchte den Namen der Festplatte für die Spalten, mit denen ich arbeitete. In diesem Fall 'Held'

Verwandte Themen