Skip to content

Commit 744dd3d

Browse files
Fix to support Laravel 5.8 and 6
1 parent b7ceec4 commit 744dd3d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/CloudinaryServiceProvider.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,18 @@ function () {
9494
*/
9595
protected function bootComponents()
9696
{
97-
Blade::component('cloudinary::components.button', 'cld-upload-button');
98-
Blade::component('cloudinary::components.image', 'cld-image');
99-
Blade::component('cloudinary::components.video', 'cld-video');
97+
Blade::component('cloudinary::components.button', $this->getComponentName('cld-upload-button'));
98+
Blade::component('cloudinary::components.image', $this->getComponentName('cld-image'));
99+
Blade::component('cloudinary::components.video', $this->getComponentName('cld-video'));
100+
}
101+
102+
protected function getComponentName($componentName)
103+
{
104+
if( (int)$this->app->version()[0] <= 6 ) {
105+
$componentName = str_replace("-", "_", $componentName);
106+
}
107+
108+
return $componentName;
100109
}
101110

102111
protected function bootCommands()

0 commit comments

Comments
 (0)