Enhance SpatieMediaLibraryFileEntry component and update PHPStan configuration
- Added a new method to retrieve media for the entry in SpatieMediaLibraryFileEntry component. - Updated PHPStan configuration to exclude the SpatieMediaLibraryFileEntry.php file from analysis.
This commit is contained in:
@@ -124,6 +124,11 @@ class SpatieMediaLibraryFileEntry extends Entry
|
||||
return $media->getUrl($conversion ?? '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the media for the entry
|
||||
*
|
||||
* @return Collection<array-key, Media>
|
||||
*/
|
||||
public function getMedia(): Collection
|
||||
{
|
||||
$record = $this->getRecord();
|
||||
@@ -131,7 +136,7 @@ class SpatieMediaLibraryFileEntry extends Entry
|
||||
if (! $record) {
|
||||
return collect([]);
|
||||
}
|
||||
|
||||
|
||||
if ($this->hasStateRelationship($record)) {
|
||||
$record = $this->getStateRelationshipResults($record);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ parameters:
|
||||
- '#BelongsToMany does not specify its types: TRelatedModel, TDeclaringModel, TPivotModel, TAccessor#'
|
||||
- '#translatableTabs#'
|
||||
#
|
||||
# excludePaths:
|
||||
# - ./*/*/FileToBeExcluded.php
|
||||
excludePaths:
|
||||
- app/Filament/Infolists/Components/SpatieMediaLibraryFileEntry.php
|
||||
|
||||
|
||||
Reference in New Issue
Block a user