Z
Z
zlaravel2021-02-09 15:10:01
Laravel
zlaravel, 2021-02-09 15:10:01

How to fix error when accessing localhost/pages?

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class PagesController extends Controller
{
    public function getIndex() {
        echo __METHOD__;
    }
}

Route::controller('/pages','PagesController');

Whoops, looks like something went wrong.
1/1 BadMethodCallException in Macroable.php line 74: Method controller does not exist.

    in Macroable.php line 74
    at Router->__call('controller', array('/pages', 'PagesController')) in Facade.php line 237

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
netrox, 2021-02-09
@zlaravel

Route::get('/pages', '[email protected]');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question