"Target [App \ Http \ Controllers \ Controller] is not real."

I'm trying to follow the laracasts tutorial on laravel basics, but after you created composer and laravel without any problems, I can’t get the route file for working with the controller. I reinstalled laravel, copied it exactly, like laracasts has it, but still nothing, does anyone see something wrong with these two files?

routes.php files

<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', ' Controller@index '); Route::get('contact', ' Controller@contact '); 

controller.php file

 <?php namespace App\Http\Controllers; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; abstract class Controller extends BaseController { use DispatchesJobs, ValidatesRequests; public function ___construct() { $this->middleware('guest'); } public function index() { return 'hello world!'; } public function contact() { return 'Contact me!'; } } 

I have it hosted on localhost: 8888 using the phps server command if this is any help.

+5
source share
1 answer

The reason may be that your controller class is abstract, therefore, it is not real. Remove the keyword abstract.

+7
source

All Articles