Skip to content

Exception output of missing function in controller is wrong #27344

@SamuelNitsche

Description

@SamuelNitsche
  • Laravel Version: 5.7.22
  • PHP Version: 7.2.4
  • Database Driver & Version: -

Description:

When you add a route to a controller function that does not exist, laravel throws a ReflectionException instead of a BadMethodCallException. The exception says that the function () does not exist.

bildschirmfoto 2019-01-29 um 11 23 19

Steps To Reproduce:

  1. Edit your web.php file like this (does not happen when you pass the controller and function as string)
Route::get('/test', [TestController::class, 'index']);
  1. Create the TestController but don't create function index
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TestController extends Controller
{
    //
}
  1. Visit the new route

Expected behaviour would be that laravel tells which function does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions