-
Notifications
You must be signed in to change notification settings - Fork 90
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
Laravel integration doesn't work #34
Comments
Is Shippo inside of your vendors folder of your Laravel installation? Also, do you have Any additional details about your configuration would be really helpful in troubleshooting why the class isn't being found. |
Looks to me like your missing a backslash in front of |
Hi Casperbakker To use the bindings, either user Composer's autoload: require_once('vendor/autoload.php'); require_once('/path/to/vendor/shippo/shippo-php/lib/Shippo.php'); Please let me know Steps in easy and learners way so that i can understand. i am totally novice. |
I am getting error after adding this \Shippo::setApiKey($this->app['config']['services.shippo.key']); to service.php. ERRROR: [Symfony\Component\Debug\Exception\FatalThrowableError] My services.php looks like this after adding line
** \Shippo::setApiKey($this->app['config']['services.shippo.key']);** ]; |
This has nothing to do with Laravel, it is just normal PHP namespacing. This package is recommended to use with composer, if you do that in a blank PHP project, you need the But, with Laravel that autoloader is already loaded by the framework. So you can just use those classes as normal, without the need for including files. If you are getting |
You can simple not add any PHP to any of the files in the config/ directory, other then things that are added to that array. It is probably a bad idea to load Shippo on every request. But if you want that, you should add that in a ServiceProvider, or just in the code right before doing something with the Shippo client. But this is just basic Laravel, it has nothing to do with this Shippo library. Maybe read a bit more of the Laravel docs? They are pretty good. |
Please let me know how to integrate "shippo-php-client" in laravel and how to test laravel project. |
Haha, please do my work for me. This is just basic PHP stuff. You have to figure some things out for yourself. |
Thanks Brother! # |
A note on the service provider: If he sets the defer flag on his service provider then the closure will only be evaluated when it is retrieved from the container. This will have a much smaller footprint while still letting him inject the service. Although I think that is beyond the scope of his problem. |
I have it working fine in my Laravel project. Follow this guide: |
Class 'App\Http\Controllers\Front\Shippo_Shipment' not found
The text was updated successfully, but these errors were encountered: