我想将查询构建器与LIKE运算符一起使用,但它无法正常工作.
这是我的控制器中的代码:
public function listall($query) {
$Clubs = Club::where('clubs.name', 'like', "%$query%")
->Join('leagues', 'clubs.league_id', '=', 'leagues.id')
->select('clubs.id', 'clubs.name', 'clubs.blason', 'leagues.name as league_name')
->orderBy('clubs.name')
->get();
return Response::json($Clubs);
}
Run Code Online (Sandbox Code Playgroud)
这是我的Javascript代码:
<script type="text/javascript">
function hasard(min,max){
return min+Math.floor(Math.random()*(max-min+1));
}
jQuery(document).ready(function($) {
// Set the Options for "Bloodhound" suggestion engine
var engine = new Bloodhound({
remote: {
url: "{{ url('club/listall') }}"+'/%QUERY%',
wildcard: '%QUERY%'
},
datumTokenizer: Bloodhound.tokenizers.obj.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace
});
$(".club-search").typeahead({
hint: true,
highlight: true,
minLength: 1
}, {
source: engine.ttAdapter(),
display: "name",
// This will be …Run Code Online (Sandbox Code Playgroud) 在服务器上,安装了 Nginx。Let's Encrypt 在 www.domain.com 上运行良好,但不适用于 static.domain.com
使用 PuTTY,当我输入时:
sudo letsencrypt certonly -a webroot --webroot-path=/var/www/site/domain -d static.domain.com -d domain.com -d www.domain.com
我有以下问题:
Failed authorization procedure. static.domain.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://static.domain.com/.well-known/acme-challenge/c6zngeBwPq42KLXT2ovW-bVPOQ0OHuJ7Fw_FbfL8XfY: "<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>"
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: static.domain.com
Type: unauthorized
Detail: Invalid response from
http://static.domain.com/.well-known/acme-challenge/c6zngeBwPq42KLXT2ovW-bVPOQ0OHuJ7Fw_FbfL8XfY:
"<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>"
To fix these errors, please …Run Code Online (Sandbox Code Playgroud) encryption ×1
javascript ×1
laravel ×1
lets-encrypt ×1
mysql ×1
nginx ×1
sql-like ×1
unauthorized ×1