PHP Class Plank\Mediable\MediaMover

Author: Sean Fraser ([email protected])
Show file Open project: plank/laravel-mediable

Protected Properties

Property Type Description
$filesystem Illuminate\Filesystem\FilesystemManager

Public Methods

Method Description
__construct ( Illuminate\Filesystem\FilesystemManager $filesystem ) Constructor.
move ( Media $media, string $directory, $filename = null ) : void Move the file to a new location on disk.

Protected Methods

Method Description
removeExtensionFromFilename ( string $filename, string $extension ) : string Remove the media's extension from a filename.

Method Details

__construct() public method

Constructor.
public __construct ( Illuminate\Filesystem\FilesystemManager $filesystem )
$filesystem Illuminate\Filesystem\FilesystemManager

move() public method

Will invoke the save() method on the model after the associated file has been moved to prevent synchronization errors
public move ( Media $media, string $directory, $filename = null ) : void
$media Media
$directory string directory relative to disk root
return void

removeExtensionFromFilename() protected method

Remove the media's extension from a filename.
protected removeExtensionFromFilename ( string $filename, string $extension ) : string
$filename string
$extension string
return string

Property Details

$filesystem protected property

protected FilesystemManager,Illuminate\Filesystem $filesystem
return Illuminate\Filesystem\FilesystemManager