我关注多对多Laravel关系中的自动命名表.
例如:
Schema::create('feature_product', function (Blueprint $table) {
Run Code Online (Sandbox Code Playgroud)
将表名更改为:
Schema::create('product_feature', function (Blueprint $table) {
Run Code Online (Sandbox Code Playgroud)
我的关系有误.
有什么问题product_feature?
我一直在努力与VSCode和JSHint一起找到摆脱这种语法高亮的方法.似乎JSHint无法识别Async/Await语法.
在这里你可以找到我正在谈论的截图.
我的JSHint版本: jshint-esnext v2.7.0-3
我必须将我的状态更改为方法中的单词,但是当我将参数作为字符串传递给方法时,我从以下两个条件得到结果:
public static function Status($status)
{
if ($status == true || $status == True || $status == 'true' || $status == 'True' || $status == 1)
{
echo "true";
}
if ($status == false || $status == False || $status == 'false' || $status == 'False' || $status == 0)
{
echo "false";
}
}
Run Code Online (Sandbox Code Playgroud)
当我将'False'值作为字符串传递给方法时,我得到truefalse结果,但我对字符串值没有任何问题.
我必须做一个扩展,在上下文菜单中单击文本时,在回调中打开扩展菜单弹出窗口。
chrome.runtime.onInstalled.addListener(function() {
var context = "selection";
var title = "Google for Selected Text";
var id = chrome.contextMenus.create({"title": title, "contexts":["selection"],
"id": "context" + context});
});
// add click event
chrome.contextMenus.onClicked.addListener(onClickHandler);
// The onClicked callback function.
function onClickHandler(info, tab) {
var sText = info.selectionText;
var url = "https://www.google.com/search?q=" + encodeURIComponent(sText);
//what i have put here to open extension popup
};
Run Code Online (Sandbox Code Playgroud)
在这种情况下,当我单击菜单时,将使用此搜索打开一个新选项卡。