davispeixoto / Laravel-4-Salesforce

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

Docs #2

Closed kilrizzy closed 10 years ago

kilrizzy commented 10 years ago

Noticed it wasn't mentioned in the docs what to add to the aliases in app.php. Still new to Laravel so was trying a few out with no success:

'Salesforce' => 'Davispeixoto\LaravelSalesforce\Facades', 'Salesforce' => 'LaravelSalesforce\Facades',

Wasn't sure what you're using but it would be a huge help so I can try this package out. Also noticed the example in the docs just needs an additional close parenthesis:

echo print_r(Salesforce::describeLayout('Account'));

davispeixoto commented 10 years ago

kilrizzy, thanks for your input.

There are some shortcuts, tips and tricks in Laravel world. I use one of them in my packages that makes unnecessary to add the aliases in config/app.php. The aliases declaration is inside my packages, so whenever they are called, the aliases are loaded and available for using. You really just need to add the ServiceProvider line in order to make them work.

I will correct the example provided.

This package is just a wrap around latest the Force.com Toolkit. All methods available there, are available in my package under a Laravel 4 syntax convention. Even the order of parameters in methods are the same.

Thanks again for your input, and feel free to make suggestions.

kilrizzy commented 10 years ago

Thanks for the help. Perhaps I'm doing something wrong then but even with my service provider set and config updated I'm still getting "Class 'Salesforce' not found" using the same /test routing example

kilrizzy commented 10 years ago

Though I was able to see the exact naming in your Service Provider and setting it manually in app.php "'Salesforce' => 'Davispeixoto\LaravelSalesforce\Facades\Salesforce'" worked. Strange

davispeixoto commented 10 years ago

Really strange, because I'm using this in a local project and getting success...

Does your IDE adding the "use" directive in your routes file? If yes, this may be the problem.

However, I will double check this in a fresh install at home and reply. Thx again for sharing.

kilrizzy commented 10 years ago

No problem, I'm just using SublimeText so I don't believe it's automatically adding anything extra than it should be. I'm in Laravel4.1, not sure if there were any changes from 4.0 that might have sparked an issue. Possibly unrelated but when I tried Salesforce::query(...) I ran into:

Interface 'Davispeixoto\ForceDotComToolkitForPhp\Iterator' not found

on the QueryResult class. Again, probably just user error but wanted to give you a heads up. I think I'm going to run through Force.com toolkit directly and see if I can bypass any of this. Like I mentioned still a newbie so might just be something with my setup / environment

davispeixoto commented 10 years ago

After some work hereI could not find why Laravel can't load the Salesforce class in a fresh install.

This is a real issue. I'm reopening it and will work on it as I can.

I will update whenever I make any progress.

davispeixoto commented 10 years ago

Todd,

the Iterator issue is really quick to fix.

It is in the underlying project I made... I will update it in a couple hours.

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

I am also running into this issue Interface 'Davispeixoto\ForceDotComToolkitForPhp\Iterator' not found when using query. I have a big salesforce project to do so im sure i'll be annoying you a lot. I'll try to fix what i can on my own and post the fixes though.

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

Um abraço, Perdigão.

toddmcbrearty commented 10 years ago

Wonderful! thanks so much. And thanks for the quick responses.

davispeixoto commented 10 years ago

No problem guys...

The unique problem is I'm in the business time right now, this is why I can't work on it immediately, hehe.

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

Wonderful! thanks so much. And thanks for the quick responses.

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

Um abraço, Perdigão.

toddmcbrearty commented 10 years ago

HA! i wont tell :)

davispeixoto commented 10 years ago

It's fixed already along with alias autoload bug.

There is no need to add the aliases now.

Thx for your report. Enjoy.

davispeixoto commented 10 years ago

Jeff/Todd,

can you provide feedback on this issue about the fix I've pushed yes'day?

It would be valuable to all community.

Thank you.

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

HA! i wont tell :)

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

Um abraço, Perdigão.