I can confirm there's a bug on 4.2. I just:
git clone -b develop https://github.com/laravel/laravel.git
composer update
php artisan routes
And got the very same error.
Just posted an issue: https://github.com/laravel/laravel/issues/2892
Question
I have a fresh install of laravel 4.2 After playing around a little bit with creating some routes I ended up enable to run the command "php artisan routes" in order to list all the available routes of my app. The error messages :
PHP Fatal error: Call to a member function render() on a non-object in /Users/imac/Sites/my-app/vendor/laravel/framework/src/Illuminate/Console/Command.php on line 276
PHP Stack trace:
PHP 1. {main}() /Users/imac/Sites/my-app/artisan:0
PHP 2. Symfony\Component\Console\Application->run() /Users/imac/Sites/my-app/artisan:59
PHP 3. Symfony\Component\Console\Application->doRun() /Users/imac/Sites/my-app/vendor/symfony/console/Symfony/Component/Console/Application.php:124
PHP 4. Symfony\Component\Console\Application->doRunCommand() /Users/imac/Sites/my-app/vendor/symfony/console/Symfony/Component/Console/Application.php:193
PHP 5. Illuminate\Console\Command->run() /Users/imac/Sites/my-app/vendor/symfony/console/Symfony/Component/Console/Application.php:897
PHP 6. Symfony\Component\Console\Command\Command->run() /Users/imac/Sites/my-app/vendor/laravel/framework/src/Illuminate/Console/Command.php:100
PHP 7. Illuminate\Console\Command->execute() /Users/imac/Sites/my-app/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
PHP 8. Illuminate\Foundation\Console\RoutesCommand->fire() /Users/imac/Sites/my-app/vendor/laravel/framework/src/Illuminate/Console/Command.php:112
PHP 9. Illuminate\Foundation\Console\RoutesCommand->displayRoutes() /Users/imac/Sites/my-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/RoutesCommand.php:74
PHP 10. Illuminate\Console\Command->table() /Users/imac/Sites/my-app/vendor/laravel/framework/src/Illuminate/Foundation/Console/RoutesCommand.php:123
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to a member function render() on a non-object","file":"\/Users\/imac\/Sites\/my-app\/vendor\/laravel\/framework\/src\/Illuminate\/Console\/Command.php","line":276}}
I ended up reverting all the routes.php and keep this only route :
Route::get('/', function()
{
return "Homepage here";
});
I have googling a lot but nobody seemed to have already encounter this kind of error.
Solution
I can confirm there's a bug on 4.2. I just:
git clone -b develop https://github.com/laravel/laravel.git
composer update
php artisan routes
And got the very same error.
Just posted an issue: https://github.com/laravel/laravel/issues/2892
OTHER TIPS
please make sure that in your routes.php file you have Route::resource('[routename]','[controllername]'); you can check more in their docs here laravel docs on controllers