我正在尝试实施Laravel Scout和ElasticSearch。我遇到了这两个挑战:当我在cmd上运行修补程序时,它会给出这个输出:
C:\xampp\htdocs\blacapollo>php artisan scout:import "App\Albums"
Imported [App\Albums] models up to ID: 2
All [App\Albums] records have been imported.
C:\xampp\htdocs\blacapollo>php artisan tinker
Psy Shell v0.7.2 (PHP 7.0.8 ΓÇö cli) by Justin Hileman
>>> App/Albums::search('come and')->get();
PHP Fatal error: Class 'Albums' not found in eval()'d code on line 1
>>>
我想也许可以绕过它,所以我继续编写控制器并按照本教程查看 - Basic Search Functionality with ElasticSearch & Laravel Scout
控制器:
public function search(Request $request){
$searchedSongs = '';
if($request->has('search')){
$searchedSongs = Songs::search($request->input('search'))->get();
}
return view('search.results')->with('searchedSongs', $searchedSongs);
}
刀片形式:
<form id="elasticScout" action="/SearchQuery" method="get">
<div class="mysearchbar">
<input name="search" placeholder="Search...">
</div>
</form>
@if(!empty($searchedSongs))
@foreach($searchedSongs as $searchedSong)
<h1>{{ $searchedSong->originalName }} </h1>
@endforeach
@endif
当我访问视图并尝试搜索查询时,现有模型会返回此错误:
BadRequest400Exception in Connection.php line 682:
parsing_exception: no [query] registered for [filtered]
in Connection.php line 682
at Connection->tryDeserializeError(array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}'), 'Elasticsearch\Common\Exceptions\BadRequest400Exception') in Connection.php line 659
at Connection->tryDeserialize400Error(array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}')) in Connection.php line 579
at Connection->process4xxError(array('http_method' => 'GET', 'scheme' => 'http', 'uri' => '/scout/songs/_search?size=10000', 'body' => '{"query":{"filtered":{"filter":[],"query":{"bool":{"must":[{"match":{"_all":{"query":"come","fuzziness":1}}}]}}}}}', 'headers' => array('host' => array('localhost:9200'))), array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}'), array()) in Connection.php line 261
at Connection->Elasticsearch\Connections\{closure}(array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}')) in FulfilledPromise.php line 25
at FulfilledPromise->then(object(Closure), null, null) in CompletedFutureValue.php line 55
at CompletedFutureValue->then(object(Closure), null, null) in Core.php line 341
at Core::proxy(object(CompletedFutureArray), object(Closure)) in Connection.php line 282
at Connection->Elasticsearch\Connections\{closure}(array('http_method' => 'GET', 'scheme' => 'http', 'uri' => '/scout/songs/_search?size=10000', 'body' => '{"query":{"filtered":{"filter":[],"query":{"bool":{"must":[{"match":{"_all":{"query":"come","fuzziness":1}}}]}}}}}', 'headers' => array('host' => array('localhost:9200'))), object(Connection), object(Transport), array()) in Connection.php line 159
at Connection->performRequest('GET', '/scout/songs/_search', array('size' => '10000'), '{"query":{"filtered":{"filter":[],"query":{"bool":{"must":[{"match":{"_all":{"query":"come","fuzziness":1}}}]}}}}}', array(), object(Transport)) in Transport.php line 100
at Transport->performRequest('GET', '/scout/songs/_search', array('size' => '10000'), array('query' => array('filtered' => array('filter' => array(), 'query' => array('bool' => array('must' => array(array('match' => array('_all' => array('query' => 'come', 'fuzziness' => '1'))))))))), array()) in Client.php line 1345
at Client->performRequest(object(Search)) in Client.php line 849
at Client->search(array('size' => '10000')) in ElasticsearchEngine.php line 209
at ElasticsearchEngine->performSearch(object(Builder), array('filters' => array(), 'size' => '10000')) in ElasticsearchEngine.php line 109
at ElasticsearchEngine->search(object(Builder)) in Engine.php line 70
at Engine->get(object(Builder)) in Builder.php line 149
at Builder->get() in SearchController.php line 24
at SearchController->search(object(Request))
at call_user_func_array(array(object(SearchController), 'search'), array(object(Request))) in Controller.php line 55
at Controller->callAction('search', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(SearchController), 'search') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 642
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 644
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 618
at Router->dispatchToRoute(object(Request)) in Router.php line 596
at Router->dispatch(object(Request)) in Kernel.php line 267
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53
at require_once('C:\xampp\htdocs\blacapollo\public\index.php') in server.php line 21
1/2
BadRequest400Exception in Connection.php line 681:
{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}
in Connection.php line 681
at Connection->tryDeserializeError(array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}'), 'Elasticsearch\Common\Exceptions\BadRequest400Exception') in Connection.php line 659
at Connection->tryDeserialize400Error(array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}')) in Connection.php line 579
at Connection->process4xxError(array('http_method' => 'GET', 'scheme' => 'http', 'uri' => '/scout/songs/_search?size=10000', 'body' => '{"query":{"filtered":{"filter":[],"query":{"bool":{"must":[{"match":{"_all":{"query":"come","fuzziness":1}}}]}}}}}', 'headers' => array('host' => array('localhost:9200'))), array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}'), array()) in Connection.php line 261
at Connection->Elasticsearch\Connections\{closure}(array('transfer_stats' => array('url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'content_type' => 'application/json; charset=UTF-8', 'http_code' => '400', 'header_size' => '96', 'request_size' => '205', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '0.016', 'namelookup_time' => '0', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '114', 'size_download' => '227', 'speed_download' => '14187', 'speed_upload' => '7125', 'download_content_length' => '227', 'upload_content_length' => '114', 'starttransfer_time' => '0.016', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '::1', 'certinfo' => array(), 'primary_port' => '9200', 'local_ip' => '::1', 'local_port' => '6969', 'error' => '', 'errno' => '0'), 'curl' => array('error' => '', 'errno' => '0'), 'effective_url' => 'http://localhost:9200/scout/songs/_search?size=10000', 'headers' => array('content-type' => array('application/json; charset=UTF-8'), 'content-length' => array('227')), 'version' => '1.1', 'status' => '400', 'reason' => 'Bad Request', 'body' => '{"error":{"root_cause":[{"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22}],"type":"parsing_exception","reason":"no [query] registered for [filtered]","line":1,"col":22},"status":400}')) in FulfilledPromise.php line 25
at FulfilledPromise->then(object(Closure), null, null) in CompletedFutureValue.php line 55
at CompletedFutureValue->then(object(Closure), null, null) in Core.php line 341
at Core::proxy(object(CompletedFutureArray), object(Closure)) in Connection.php line 282
at Connection->Elasticsearch\Connections\{closure}(array('http_method' => 'GET', 'scheme' => 'http', 'uri' => '/scout/songs/_search?size=10000', 'body' => '{"query":{"filtered":{"filter":[],"query":{"bool":{"must":[{"match":{"_all":{"query":"come","fuzziness":1}}}]}}}}}', 'headers' => array('host' => array('localhost:9200'))), object(Connection), object(Transport), array()) in Connection.php line 159
at Connection->performRequest('GET', '/scout/songs/_search', array('size' => '10000'), '{"query":{"filtered":{"filter":[],"query":{"bool":{"must":[{"match":{"_all":{"query":"come","fuzziness":1}}}]}}}}}', array(), object(Transport)) in Transport.php line 100
at Transport->performRequest('GET', '/scout/songs/_search', array('size' => '10000'), array('query' => array('filtered' => array('filter' => array(), 'query' => array('bool' => array('must' => array(array('match' => array('_all' => array('query' => 'come', 'fuzziness' => '1'))))))))), array()) in Client.php line 1345
at Client->performRequest(object(Search)) in Client.php line 849
at Client->search(array('size' => '10000')) in ElasticsearchEngine.php line 209
at ElasticsearchEngine->performSearch(object(Builder), array('filters' => array(), 'size' => '10000')) in ElasticsearchEngine.php line 109
at ElasticsearchEngine->search(object(Builder)) in Engine.php line 70
at Engine->get(object(Builder)) in Builder.php line 149
at Builder->get() in SearchController.php line 24
at SearchController->search(object(Request))
at call_user_func_array(array(object(SearchController), 'search'), array(object(Request))) in Controller.php line 55
at Controller->callAction('search', array(object(Request))) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(SearchController), 'search') in Route.php line 189
at Route->runController() in Route.php line 144
at Route->run(object(Request)) in Router.php line 642
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 644
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 618
at Router->dispatchToRoute(object(Request)) in Router.php line 596
at Router->dispatch(object(Request)) in Kernel.php line 267
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53
at require_once('C:\xampp\htdocs\blacapollo\public\index.php') in server.php line 21
答案 0 :(得分:1)
您可以改为尝试App\Albums::search('come and')->get();
。
实现名称空间的正确方法是使用反斜杠\
而不是反斜杠/
。
答案 1 :(得分:0)
有时需要清除缓存
composer dump-autoload
我希望它也对您有用