Home > Mobile >  (1/1) ErrorException ReflectionFunction::__construct() ex
(1/1) ErrorException ReflectionFunction::__construct() ex

Time:05-25

the problem

(1/1) ErrorException ReflectionFunction::__construct() expects parameter 1 to be string, array given

code

****Route****
-------
   <?PHP
   use Illuminate\Support\Facades\Route;
  use App\Http\Controllers\usercontroller;
   Route::get('/register', [usercontroller::class, 'register']);

****controller****
--------
    <?php

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;


   class usercontroller extends Controller{

    public function register(){
        return View('register');
    }}

CodePudding user response:

Try the older notation of Route declaration Route::get('/register', 'App\Http\Controllers\usercontroller@register');

  • Related