Property | Type | Description | |
---|---|---|---|
$model |
Method | Description | |
---|---|---|
__construct ( |
||
all ( ) : Illuminate\Database\Eloquent\Collection | Get all media. | |
getByCollectionName ( string $collectionName ) : Illuminate\Database\Eloquent\Collection | * Get all media for the given type and collection name. | |
getByIds ( array $ids ) : Illuminate\Database\Eloquent\Collection | * Get media by ids. | |
getByModelType ( string $modelType ) : Illuminate\Database\Eloquent\Collection | * Get all media for the given type. | |
getByModelTypeAndCollectionName ( string $modelType, string $collectionName ) : Illuminate\Database\Eloquent\Collection | * Get all media for the given type and collection name. | |
getCollection ( Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia $model, string $collectionName, array | callable $filter = [] ) : |
Get all media in the collection. |
Method | Description | |
---|---|---|
applyFilterToMediaCollection ( |
Apply given filters on media. | |
getDefaultFilterFunction ( array $filters ) : Closure | Convert the given array to a filter function. | |
loadMedia ( Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia $model, string $collectionName ) : mixed | Load media by collectionName. | |
mediaIsPreloaded ( Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia $model ) : boolean | * Determine if media is already preloaded on this model. |
public all ( ) : Illuminate\Database\Eloquent\Collection | ||
return | Illuminate\Database\Eloquent\Collection |
protected applyFilterToMediaCollection ( |
||
$media | ||
$filter | array | callable | |
return |
public getByCollectionName ( string $collectionName ) : Illuminate\Database\Eloquent\Collection | ||
$collectionName | string | |
return | Illuminate\Database\Eloquent\Collection |
public getByModelType ( string $modelType ) : Illuminate\Database\Eloquent\Collection | ||
$modelType | string | |
return | Illuminate\Database\Eloquent\Collection |
public getByModelTypeAndCollectionName ( string $modelType, string $collectionName ) : Illuminate\Database\Eloquent\Collection | ||
$modelType | string | |
$collectionName | string | |
return | Illuminate\Database\Eloquent\Collection |
protected getDefaultFilterFunction ( array $filters ) : Closure | ||
$filters | array | |
return | Closure |
protected mediaIsPreloaded ( Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia $model ) : boolean | ||
$model | Spatie\MediaLibrary\HasMedia\Interfaces\HasMedia | |
return | boolean |