mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 10:21:06 +03:30
testing
This commit is contained in:
+8
-1
@@ -11,7 +11,7 @@ class Item extends Model implements HasMedia
|
|||||||
{
|
{
|
||||||
use HasMediaTrait;
|
use HasMediaTrait;
|
||||||
|
|
||||||
public $fillable = [ 'name' , 'size' , 'unique_id' , 'specific' , 'note' , 'user_id' , 'udi' , 'status' , 'repair' , 'package_id' , 'creator_id' ];
|
public $fillable = [ 'name' , 'size' , 'unique_id' , 'specific' , 'note' , 'user_id' , 'udi' , 'status' , 'repair' , 'package_id' , 'creator_id' ];
|
||||||
|
|
||||||
public function package()
|
public function package()
|
||||||
{
|
{
|
||||||
@@ -59,4 +59,11 @@ class Item extends Model implements HasMedia
|
|||||||
->nonQueued()
|
->nonQueued()
|
||||||
->performOnCollections( 'images' );
|
->performOnCollections( 'images' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static function getValidCollections(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'images' ,
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,14 @@ trait HasMediaTrait
|
|||||||
{
|
{
|
||||||
return $this->morphMany(Media::class, 'model')->where('collection_name', 'main_images');
|
return $this->morphMany(Media::class, 'model')->where('collection_name', 'main_images');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function isValidMediaCollection(string $collectionName): bool
|
||||||
|
{
|
||||||
|
return in_array($collectionName, static::getValidCollections());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static function getValidCollections(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Services\Media\UrlGenerator;
|
|||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
use Spatie\MediaLibrary\UrlGenerator\BaseUrlGenerator;
|
use Spatie\MediaLibrary\UrlGenerator\BaseUrlGenerator;
|
||||||
|
|
||||||
|
|
||||||
class S3UrlGenerator extends BaseUrlGenerator
|
class S3UrlGenerator extends BaseUrlGenerator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user