@@ -27,13 +27,13 @@ public function medially()
27
27
/**
28
28
* Attach Media Files to a Model
29
29
*/
30
- public function attachMedia ($ file )
30
+ public function attachMedia ($ file, $ options = [] )
31
31
{
32
32
if (! file_exists ($ file )) {
33
33
throw new Exception ('Please pass in a file that exists ' );
34
34
}
35
35
36
- $ response = resolve (CloudinaryEngine::class)->uploadFile ($ file ->getRealPath ());
36
+ $ response = resolve (CloudinaryEngine::class)->uploadFile ($ file ->getRealPath (), $ options );
37
37
38
38
$ media = new Media ();
39
39
$ media ->file_name = $ response ->getFileName ();
@@ -47,9 +47,9 @@ public function attachMedia($file)
47
47
/**
48
48
* Attach Rwmote Media Files to a Model
49
49
*/
50
- public function attachRemoteMedia ($ remoteFile )
50
+ public function attachRemoteMedia ($ remoteFile, $ options = [] )
51
51
{
52
- $ response = resolve (CloudinaryEngine::class)->uploadFile ($ remoteFile );
52
+ $ response = resolve (CloudinaryEngine::class)->uploadFile ($ remoteFile, $ options );
53
53
54
54
$ media = new Media ();
55
55
$ media ->file_name = $ response ->getFileName ();
@@ -106,19 +106,19 @@ public function fetchLastMedia()
106
106
/**
107
107
* Update the Media files relating to a particular Model record
108
108
*/
109
- public function updateMedia ($ file )
109
+ public function updateMedia ($ file, $ options = [] )
110
110
{
111
111
$ this ->detachMedia ();
112
- $ this ->attachMedia ($ file );
112
+ $ this ->attachMedia ($ file, $ options );
113
113
}
114
114
115
115
/**
116
116
* Update the Media files relating to a particular Model record (Specificially existing remote files)
117
117
*/
118
- public function updateRemoteMedia ($ file )
118
+ public function updateRemoteMedia ($ file, $ options = [] )
119
119
{
120
120
$ this ->detachMedia ();
121
- $ this ->attachRemoteMedia ($ file );
121
+ $ this ->attachRemoteMedia ($ file, $ options );
122
122
}
123
123
124
124
}
0 commit comments