There are questions on here and around Google asking about the same thing, but being a noob, I'm still not getting this. I'm using Laravel 4.
Trying to have a file for random classes. Doesn't load.
The class is in:
app/classes/Helpers.php
Helpers.php:
class Helpers {
public function randomLowerCase($amount)
{
strtolower($str_random($amount))
}
};
I've placed my classes in composer.json.
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/classes",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
autoload_classmap.php:
'Helpers' => $baseDir . '/app/classes/Helpers.php',
And also ran
composer dump-autoload
I'm running the function in a UserController.php file in controllers, but I keep getting Call to undefined function randomLowerCase()
$helpers = new Helpers;$helpers->randomLowerCase();