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

I'm trying to follow laracasts tutorial on laravel fundamentals but after getting composer and laravel installed with no problems I can't get my routes file to work with the controller I've reinstalled laravel copied it exactly how laracasts has his but still nothing, anyone see anything 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's 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 phps server command if that is any help.

Answers


The reason might be that your controller class is abstract, hence it's not instantiable. Remove the abstract keyword.


Need Your Help

Multiply every element of a list by a number

python

I would like to multiply all elements of a list by a number. I know the other ways to do it but I want to know Why isn't this working? I am getting the very same list as an output.

how to bind to the results of a query in WPF

c# wpf binding

I have a query that hits a service and returns the results back to me as an indexed collection