1 | <?php |
||
27 | trait Guided |
||
28 | { |
||
29 | use GuidedRepository; |
||
30 | |||
31 | /** |
||
32 | * @throws BadImplementation |
||
33 | */ |
||
34 | public static function bootGuided(): void |
||
42 | |||
43 | /** |
||
44 | * Get resized/thumbnail photo link. |
||
45 | * |
||
46 | * @param string $type request type (thumbnail or resize) |
||
47 | * @param array $params parameters to pass to route |
||
48 | */ |
||
49 | public function getRoutedUrl(string $type, array $params = []): string |
||
63 | |||
64 | /** |
||
65 | * Whether image is safe for deleting. |
||
66 | * Since a single image may be re-used this method is used to determine |
||
67 | * when an image can be safely deleted from disk. |
||
68 | * |
||
69 | * @param int $safeAmount a photo is safe to delete if it is used by $safe_num amount of records |
||
70 | * |
||
71 | * @return bool whether image is safe for delete |
||
72 | */ |
||
73 | public function isSafeForDelete(int $safeAmount = 1): bool |
||
77 | |||
78 | /** |
||
79 | * Get link to resized photo. |
||
80 | * |
||
81 | * @param array $params parameters to pass to route |
||
82 | */ |
||
83 | public function routeResized(array $params = []): string |
||
87 | |||
88 | /** |
||
89 | * Get link to photo thumbnail. |
||
90 | * |
||
91 | * @param array $params parameters to pass to route |
||
92 | */ |
||
93 | public function routeThumbnail(array $params = []): string |
||
97 | |||
98 | /** |
||
99 | * Get class. |
||
100 | */ |
||
101 | public function getClassName(): string |
||
105 | |||
106 | /** |
||
107 | * Get URL/path to image. |
||
108 | * |
||
109 | * @param bool $diskRelative whether to return `full path` (relative to disk), |
||
110 | * hence skipping call to Storage facade |
||
111 | * |
||
112 | * @uses \Illuminate\Support\Facades\Storage |
||
113 | */ |
||
114 | public function getUrl(bool $diskRelative = false): string |
||
128 | |||
129 | /** |
||
130 | * Get ready image title. |
||
131 | */ |
||
132 | public function getTitle(): string |
||
136 | |||
137 | /** |
||
138 | * Get full path. |
||
139 | */ |
||
140 | public function getFullPath(): string |
||
144 | |||
145 | /** |
||
146 | * Get name. |
||
147 | */ |
||
148 | public function getName(): string |
||
152 | } |
||
153 |