Completed
Branch master (a6481d)
by Fèvre
02:09
created

XetaravelPathGenerator::getPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Xetaravel\MediaLibrary\PathGenerator;
3
4
use Spatie\MediaLibrary\Media;
5
use Spatie\MediaLibrary\PathGenerator\PathGenerator;
6
7
class XetaravelPathGenerator implements PathGenerator
8
{
9
    /**
10
     * Get the path for the given media, relative to the root storage path.
11
     *
12
     * @return string
13
     */
14
    public function getPath(Media $media) : string
15
    {
16
        return $media->collection_name . '/' . $media->id . '/';
17
    }
18
19
    /**
20
     * Get the path for conversions of the given media, relative to the root storage path.
21
     *
22
     * @return string
23
     */
24
    public function getPathForConversions(Media $media) : string
25
    {
26
        return $this->getPath($media) . 'conversions/';
27
    }
28
}
29