Logusid's avatar

ReflectionException in Container.php line 681:

Class App\Http\Controllers\App\Http\Controllers\SearchController does not exist

here is my routes\web.php

$app->get('/', function () use ($app) { return $app->version(); });

$app->group(['prefix' => 'api/v1','namespace' => 'App\Http\Controllers'], function($app) { $app->get('searchval/{searchitems}','SearchController@getsearchvalues');

});

0 likes
7 replies
zachleigh's avatar

You likely have a fatal error in your SearchController. Post the full class and we can help you find it.

vipin93's avatar

namespace' => 'App\Http\Controllers why this its already point to App\Http\Controllers

Logusid's avatar

what should i mention in namespace. i need to mention or not. if i remove namespace its work. unless not

vipin93's avatar

no need of mention of namespace unless u changed namespace of controller if u want use your controller for api then a separate route file available in routs folder api.php(version 5.3 5.4)

Logusid's avatar

@vipin93 UnexpectedValueException in Response.php line 444: The Response content must be a string or object implementing __toString(), "boolean" given.

Please help me to resolve this.

this is my function

public function fn_searchcourses($limit,$country,$searchword,$misspell) { if($limit > 100 || $misspell >2) { $returnerrors['Error']="Sorry something went wrong, The maximum limit is 100 && You should pass misspellmatch is 0,1 or 2(0-default, 1-similar,2-exact"; return $returnerrors; } $results = $this->search_Course->rep_getsearchcourses($limit,$country,$searchword,$misspell); return $results; }

Please or to participate in this conversation.