Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Cdn' not found #23

Closed
paatrick opened this issue Sep 15, 2017 · 12 comments
Closed

Class 'Cdn' not found #23

paatrick opened this issue Sep 15, 2017 · 12 comments
Assignees

Comments

@paatrick
Copy link

Hi,

When trying to call Cdn::path() I have this problem at view

Class 'Cdn' not found

Laravel 5.4
Homestead

@publiux
Copy link
Owner

publiux commented Sep 15, 2017

Can you try with CDN instead of Cdn?

@paatrick
Copy link
Author

Yes, but I still did not succeed :/

captura de tela 2017-09-15 as 16 49 18

@publiux
Copy link
Owner

publiux commented Sep 15, 2017

Which version of Laravel are you using?

@paatrick
Copy link
Author

I using Laravel 5.4

@publiux
Copy link
Owner

publiux commented Sep 15, 2017

Did you register the service provider and facade?

@paatrick
Copy link
Author

I only registered the provider, according to the documentation
Publiux\laravelcdn\CdnServiceProvider::class

How do I configure the Facade ?

@publiux
Copy link
Owner

publiux commented Sep 15, 2017

Can you try adding the following to config/app.php in the aliases array?

'CDN' => Publiux\laravelcdn\Facades\CdnFacadeAccessor::class

@paatrick
Copy link
Author

Yes, I had added this facade, however a new error appears:
Undefined index: scheme (View: /home/vagrant/Projects/myproject.com/resources/views/home/index.blade.php)

captura de tela 2017-09-15 as 17 49 55

@publiux
Copy link
Owner

publiux commented Sep 15, 2017

Can you tell me what you have set as your CDN_Url in your .env file? Alternatively, you may have specified it in the config/cdn.php file (you did remember to publish the config file, right?) The 'scheme' index is given by a pure php function, not this library, which means PHP is having a problem parsing the CDN url you have specified.

@publiux publiux self-assigned this Sep 15, 2017
@paatrick
Copy link
Author

How should I specify my CDN_Url, do I need to pass my bucket? Or just need to inform https://s3.amazonaws.com?

@publiux
Copy link
Owner

publiux commented Sep 15, 2017

You can just do https://s3.amazonaws.com . However, that's the default in the cdn.php config file. I'm not sure why it's not being parsed if you did in fact publish the cdn.php config file.

@paatrick
Copy link
Author

We were able to resolve this by correctly correcting our cloud front address. And we left our CDN_Url by default https://s3.amazonaws.com. Anyway, thank you very much for your help and congratulations for the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants