Did you add the folders to the autoloader? Did you run composer dump-autoload?
Yes, I guess I did, here's the content of my composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.2.*",
"creolab/laravel-modules": "dev-master",
"cartalyst/sentry": "2.1.*"
},
"require-dev": {
"way/generators": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php",
"app/modules"
],
"psr-0": {
"Prolife\\": "app/prolife"
}
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable"
}
"psr-0": {
"Prolife": "app/"
}
What you are using is psr-4
and run "composer dump-autoload" after
Thanks pogachar, I rolled back to psr-0 but the problem persists
ReflectionException (-1)
Class Prolife\Events\MailSender does not exist
It worked now, it was a namespacing problem
first I used psr-4
"psr-4": {
"Prolife\\": "app/prolife"
}
I changed my Mailer class namespace to the following
<?php namespace Prolife\Mailers;
I also changed the namespace in the observers.php file
Event::listen('send.mail', 'Prolife\Events\MailSender@sendTo');
And finally my MailSender class has now the following namespace
<?php namespace Prolife\Events;
THANK YOU GUYS!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community