Ad
Function Name Must Be A String In Laravel
Laravel Framework 5.6.39 I'm getting this error:
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Function name must be a string
Here is what I'm doing. In my App/RouteServiceProvider.php
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
$this->mapMercuriusRoutes();
}
protected function mapMercuriusRoutes()
{
Route::middleware(['web','auth','Mercurius'])
->namespace('\Launcher\Mercurius\Http\Controllers')
->group(base_path('routes/mercurius.php'));
}
Then my route file mercurius.php
:
// Mercurius home
Route::get('/messages', ['as' => 'home', 'uses' => '[email protected]']);
// User Profile
Route::get('/profile/refresh', '[email protected]');
Route::get('/profile/notifications', '[email protected]');
Route::post('/profile', '[email protected]');
When I go to localhost:8000/messages as listed in the Mercurius routes file I get the error. Any idea what I'm doing wrong?
EDIT: INITIAL ERRORS:
$response = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
The $pipe(...$parameters); is the highlighted one.
Symfony\Component\Debug\Exception\FatalThrowableError
…/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php152
Illuminate\Pipeline\Pipeline Illuminate\Pipeline\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php53
Illuminate\Routing\Pipeline Illuminate\Routing\{closure}
…/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php41
Ad
Answer
Make sure that Mercurius
middleware is defined and registered correctly in the Route Service Provider.
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad