for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ElfSundae\Laravel\Support\Traits;
use Illuminate\Support\Facades\Storage;
trait AssetHelper
{
/**
* Get Filesystem instance for the given identifier.
*
* @param string|null $identifier
* @return \Illuminate\Contracts\Filesystem\Filesystem
*/
protected function getFilesystem($identifier = null)
return Storage::disk($this->getFilesystemDisk($identifier));
}
* Get asset URL.
* @param string $path
* @return string|null
protected function getAssetUrl($path, $identifier = null)
if (empty($path)) {
return;
if (filter_var($path, FILTER_VALIDATE_URL) !== false) {
return $path;
return asset_url($this->getFilesystem($identifier)->url($path));
* Get disk name for filesystem.
protected function getFilesystemDisk($identifier = null)
$identifier
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return 'public';
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.