Laravel Omnipay with Omnipay/Paypal - Class not found

laravel, laravel-4, omnipay, paypal, php

Solution

I'm not familiar with `ignited/laravel-omnipay` specifically, so this may or may not be the problem, but you might try fixing the capitalisation on this line:

'driver' => 'PayPal_Express',

(note that PayPal has two capital P's).

Generally class names are not case sensitive in PHP, but if you are using a case-sensitive filesystem, then the composer autoloader will not be able to find the right class.

Problem

I'm trying to integrate the Omnipay Paypal package with my Laravel 4.1 application. I've installed the laravel-omnipay package, as suggested by Omnipay, and followed the instructions on how to set it up. I've added the laravel-omnipay package to both the providers array and the aliases array in the app.php file of Laravel. The config file has also been created. My composer.json has the following requirements: ``` "ignited/laravel-omnipay": "1.*", "omnipay/paypal": "~2.0" ``` and the config file of ignited/laravel-omnipay looks like this: ``` <?php return array( // The default gateway to use 'default' => 'paypal', // Add in each gateway here 'gateways' => array( 'paypal' => array( 'driver' => 'Paypal_Express', 'options' => array( 'solutionType' => '', 'landingPage' => '', 'headerImageUrl' => '' ) ) ) ); ``` But when I call `$gateway = Omnipay::gateway('paypal');` I'm getting the error Class '\Omnipay\Paypal\ExpressGateway' not found" Is there something I'm forgetting? :I

Original source