davispeixoto / Laravel-4-Salesforce

Force.com Toolkit for PHP port for Laravel 4
MIT License
13 stars 16 forks source link

Class 'Salesforce' not found #1

Closed richardjellis closed 10 years ago

richardjellis commented 10 years ago

I'm attempting to use this package under Laravel 4.1.0 by following the directions, but to no avail. Each run of

Route::get('/test', function() {
    echo print_r(Salesforce::create('Contact' , $object));
});

results in: Class 'Salesforce' not found.

My composer.json contains:

"require": {
        "laravel/framework": "4.1.*",
        "davispeixoto/force-dot-com-toolkit-for-php": "dev-master",
        "davispeixoto/laravel-salesforce": "dev-master"
    },

as I could not get laravel-salesforce to install correctly without the toolkit specified explicitly.

Any ideas?

davispeixoto commented 10 years ago

Richard,

thanks for pointing this. I will check it and reply as soon as possible.

Also, I intend to refactor all the force.com toolkit port, as it is badly written in the original - it i just a port from the original to be loaded under a PSR-0 / PSR-4 structure - as well as writting some unit tests to cover the basic tests.

davispeixoto commented 10 years ago

But just to give a quick, raw and dirty direction, I think you can check at the following links (I use them as base for building my packages):

Culttt Fideloper Jason Lewis Christopher Pitt

Mainly the Culttt one.

davispeixoto commented 10 years ago

I'd did correct some stuff in this package. Now it is stable. The underlying one, the Force.com Toolkit is the problem now... I will close this issue.

Again, thx for reporting

toddmcbrearty commented 10 years ago

I'm having the same issue. Class 'Salesforce' not found. Been playing with it a few hours so I figured i'd ask now. What information can i give you to help?

toddmcbrearty commented 10 years ago

so i refered to the open issue (Docs) and added this to my aliases 'Salesforce' => 'Davispeixoto\LaravelSalesforce\Facades\Salesforce' and now it works

Thanks

davispeixoto commented 10 years ago

Thx for your input, Todd.

I'm still working on fixing it. My idea is to add the alias loader into the register function inside the ServiceProvider using the bootstrap listener, thus making unnecessary to add the alias line in the config/app.php.

I have an app already running this way, but for a fresh install there is some problem I need to work in.

As of now, you can use this temporary solution, adding the aliases into config/app.php

I will update the readme with this information, but I will still continue working and let you guys know once it's fixed.

davispeixoto commented 10 years ago

Hi guys,

it's fixed.

The problem was the aliases in the boot procedure along with defer true property. These options do conflict.

I changed to defer false, thus in the booting the app, the aliases are loaded automagically.

Well, that's it. I just fixed, tested, and pushed a new release.

Thx again for your report. Enjoy.

davispeixoto commented 10 years ago

Rich and Todd,

can you provide feedback on the fix I made yes'day? It would be valuable not only for me but for the community.

Thank you, guys.

On Mon, Apr 14, 2014 at 11:22 AM, Todd notifications@github.com wrote:

so i refered to the open issue and added this to my aliases 'Salesforce' => 'Davispeixoto\LaravelSalesforce\Facades\Salesforce' and now it works

Thanks

— Reply to this email directly or view it on GitHubhttps://github.com/davispeixoto/Laravel-4-Salesforce/issues/1#issuecomment-40370953 .

Um abraço, Perdigão.

richardjellis commented 10 years ago

Sorry for the delay but I've not had chance to test this.

I've just tested it by following the docs and all works as expected. Many thanks!

Davis Peixoto mailto:notifications@github.com 15 April 2014 13:52 Rich and Todd,

can you provide feedback on the fix I made yes'day? It would be valuable not only for me but for the community.

Thank you, guys.

On Mon, Apr 14, 2014 at 11:22 AM, Todd notifications@github.com wrote:

so i refered to the open issue and added this to my aliases 'Salesforce' => 'Davispeixoto\LaravelSalesforce\Facades\Salesforce' and now it works

Thanks

— Reply to this email directly or view it on GitHubhttps://github.com/davispeixoto/Laravel-4-Salesforce/issues/1#issuecomment-40370953

.

Um abraço, Perdigão.

— Reply to this email directly or view it on GitHub https://github.com/davispeixoto/Laravel-4-Salesforce/issues/1#issuecomment-40477315.