19
19
* @property int model_id
20
20
* @property string model_type
21
21
* @property string disk
22
- * @property string filepath the full path on storage disk
22
+ * @property string filepath the full path on storage disk
23
23
* @property string filename
24
24
* @property string filetype
25
25
* @property int filesize
26
- * @property string key must be unique across a model's attachments pool
27
- * @property string group allows to group attachments
26
+ * @property string key must be unique across a model's attachments pool
27
+ * @property string group allows to group attachments
28
28
* @property string title
29
29
* @property string description
30
30
* @property string preview_url
31
31
* @property array metadata
32
- * @property string extension the file extension (read-only mutator)
33
- * @property string path the file directory (read-only mutator)
34
- * @property string url the public URL (read-only mutator)
32
+ * @property string extension the file extension (read-only mutator)
33
+ * @property string path the file directory (read-only mutator)
34
+ * @property string url the public URL (read-only mutator)
35
+ * @property string url_inline the public URL with inline switch (read-only mutator)
35
36
*
36
37
* @package Bnb\Laravel\Attachments
37
38
*/
@@ -191,7 +192,7 @@ public function model()
191
192
/**
192
193
* Register an outputting model event with the dispatcher.
193
194
*
194
- * @param \Closure|string $callback
195
+ * @param \Closure|string $callback
195
196
*
196
197
* @return void
197
198
*/
@@ -282,6 +283,7 @@ public function getUrlAttribute()
282
283
}
283
284
}
284
285
286
+
285
287
public function getUrlInlineAttribute ()
286
288
{
287
289
if ($ this ->isLocalStorage ()) {
@@ -305,7 +307,8 @@ public function toArray()
305
307
$ attributes = parent ::toArray ();
306
308
307
309
return array_merge ($ attributes , [
308
- 'url ' => $ this ->url
310
+ 'url ' => $ this ->url ,
311
+ 'url_inline ' => $ this ->url_inline ,
309
312
]);
310
313
}
311
314
@@ -585,6 +588,7 @@ protected function storageCommand($string, $filepath)
585
588
return forward_static_call_array ([$ interface , $ command ], $ args );
586
589
}
587
590
591
+
588
592
public function getConnectionName ()
589
593
{
590
594
return config ('attachments.database.connection ' ) ?? $ this ->connection ;
0 commit comments