从昨天起我正在创建一个laravel项目
composer create-project laravel/laravel project_name
我收到这些建议信息.这是正常的还是我搞砸了什么.
我在PHP 7.0.1中安装了Xampp.将wamp中的PHP选项从7.0.1切换到5.xx(只有一个选项,不记得确切的选项)从那时起,无论是创建新项目还是通过comopser require命令添加包,我都会收到这些消息.我在Wamp中将PHP版本切换回7.0.1.卸载了wamp,但仍然有消息.Unsitalled xamp,重新安装它但仍然收到这些消息.
symfony/var-dumper建议安装ext-intl(在时区转储中显示区域名称)
symfony/var-dumper建议安装ext-symfony_debug()
symfony/routing建议安装doctrine/annotations(用于使用注释加载器)
symfony/routing建议安装symfony/config(用于使用一体化路由器或任何加载器)
symfony/routing建议安装symfony/dependency-injection(用于从服务加载路由)
symfony/routing建议安装symfony/expression-language(用于表达式匹配)
和这样的长名单
我想在Bootstrap 3下拉选项中更改下拉箭头的颜色.
到目前为止,这是我的CSS,我已经改变了背景,边框,字体和选项颜色,但是箭头还没有运气:
select{
background-color: #555;
color: white;
border: 1px solid #ffffff;
}
select:after {
color: white !important;
}
option:checked {
background-color: #eee;
color:#555;
}
option:not(:checked) {
background-color: white;
color:#000;
}
Run Code Online (Sandbox Code Playgroud)
我对Bootstrap有问题。例如,当我在Codepen中检查代码时,导航栏会做出响应,从可见链接更改为汉堡菜单,但是如果我在文档中对其进行检查,则无论汉堡的分辨率是大还是小,它始终是汉堡菜单。你能帮助我吗?我正在尝试解决它,我不知道发生了什么。
body {
background-image: url("img/bg.png");
font-family: 'Raleway', sans-serif;
}Run Code Online (Sandbox Code Playgroud)
<html lang="pl">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<nav class="navbar navbar-toggleable-md navbar-light" id="commRollover">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#"><img src="img/logo.png" alt="Logo" style="height: 40px;"></a>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">O nas<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a …Run Code Online (Sandbox Code Playgroud)我正在尝试使用nodejs 将一行插入到mysql 表中。我试图通过在nodejs中将其值发送为now()来更新列creation_date(timestamp),但它给出一个错误,指出“now”未定义。当我直接在 mysql 中执行相同的 sql 查询时,它正在工作。我不知道问题出在哪里。有人可以帮我吗...这是我将值插入到 mysql 中的表中的nodejs 代码..
var sql = `INSERT INTO sales
(
user_id, name, tagline, start_date,
start_time, end_date, reg_start,
reg_end, descr, creation_date
) VALUES (
?, ?, ?, ?,
?, ?, ?,
?, ?, ?
)`
pool.query(sql, [
id, req.body.sale_name, req.body.tag, req.body.start,
req.body.stime, req.body.end, req.body.reg_start,
req.body.start, req.body.descr, now()
], function (err, result) { //further code})
Run Code Online (Sandbox Code Playgroud)
我收到的错误是:ReferenceError:现在未定义
在一个简单的HTML页面中,我使用了以下vueJs代码。我需要单击按钮,该按钮将在DOM中插入一个复选框和一个文本。
我的代码如下:
<template id="add-item-template">
<div class="input-group">
<input v-model="newItem" placeholder="add shopping list item" type="text" class="form-control">
<span class="input-group-btn">
<button @click="addItem" class="btn btn-default" type="button">Add!</button>
</span>
</div>
</template>
<div id="app" class="container">
<h2>{{ title }}</h2>
<add-item-component></add-item-component>
</div>
Run Code Online (Sandbox Code Playgroud)
而javascript部分是:
<script>
var data = {
items: [
{
text: 'Bananas',
checked: true
},
{
text: 'Apples',
checked: false
}
],
title: 'My Shopping List'
};
Vue.component('add-item-component', {
template: '#add-item-template',
data: function () {
return {
newItem: ''
}
},
props:['addItem']
});
new Vue({
el: '#app',
data: data, …Run Code Online (Sandbox Code Playgroud) 我有帖子、评论和通知表
每个帖子都有很多评论
每个评论都有很多通知
每个帖子都有很多通知
class Post extends Model
{
public function notifications() {
return $this->morphOne(Notification::class, 'to');
}
public function comments() {
return $this->hasMany(Comment::class, 'post_id');
}
public static function boot() {
parent::boot();
static::deleting(function($post) {
$post->comments()->delete();
$post->notifications()->delete();
});
}
}
Run Code Online (Sandbox Code Playgroud)
class Comment extends Model
{
public function notifications() {
return $this->morphOne(Notification::class, 'to');
}
public static function boot() {
parent::boot();
static::deleting(function($comment) {
$comment->notifications()->delete();
});
}
}
Run Code Online (Sandbox Code Playgroud)
当我删除帖子时,我应该删除通知和评论,但问题是当我删除评论时,通知不会随之删除,当我直接删除评论但我需要删除评论时,它们会被删除删除帖子时评论的通知!
我需要获取特定孩子的父 ID。
这是我的示例 JSON,如果我给实体 ID 32,它应该返回 6 作为父 ID,如果我给 30,它应该返回 5 作为父 ID。
const arr = [{
"id": 0,
"name": "My Entity",
"children": [
{
"id": 1,
"name": "MARKET",
"children": [
{
"id": 2,
"name": "Sales",
"children": [
{
"id": 3,
"name": "District 1",
"children": [
{
"id": 5,
"name": "Area 1",
"children": [
{
"entityId": 30,
"id": 26,
"name": "Mumbai"
},
{
"entityId": 31,
"id": 26,
"name": "Hyderabad"
}
],
"num": 0,
},
{
"id": 6,
"name": "Area 2", …Run Code Online (Sandbox Code Playgroud) 当我尝试获取元标记的内容时出现错误:
document.getElementById('mymetatag').content
Run Code Online (Sandbox Code Playgroud)
在 Javascript 中是有效的,但打字稿说
Property 'content' does not exist on type 'HTMLElement'
Run Code Online (Sandbox Code Playgroud)
那么如何扩展HTMLElement类型接口来支持content属性呢?
我有一个用于上传 Excel 的表单,但是在将 Excel 上传到系统时,它显示了这样的错误
未定义的数组键“表 1”
用于上传excel的包是laravel Maatwebsite\Excel\Facades\Excel;
Excel::import(new NewProducts($import->id), $path)->chain([
new AfterImport($import->id)
]);
Run Code Online (Sandbox Code Playgroud) I am using bootstrap columns that each have an image inside of different sizes which are aligned on full screen view however when using bootstrap's class img-fluid they resize for smaller viewports but instead of being aligned between the other images vertically the smaller images end up on the top of their div column.
Is there a way to vertically align these images while the image scales down?
Here is the markup:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-2">
<img …Run Code Online (Sandbox Code Playgroud)我正在尝试在我的 vue.js 应用程序中实现令牌刷新。到目前为止,这是有效的,因为它会根据 401 响应刷新存储中的令牌,但我需要做的就是让拦截器在之后再次重试原始请求。
主文件
axios.interceptors.response.use(
response => {
return response;
},
error => {
console.log("original request", error.config);
if (error.response.status === 401 && error.response.statusText === "Unauthorized") {
store.dispatch("authRefresh")
.then(res => {
//retry original request???
})
.catch(err => {
//take user to login page
this.router.push("/");
});
}
}
);
Run Code Online (Sandbox Code Playgroud)
商店.js
authRefresh(context) {
return new Promise((resolve, reject) => {
axios.get("auth/refresh", context.getters.getHeaders)
.then(response => {
//set new token in state and storage
context.commit("addNewToken", response.data.data);
resolve(response);
})
.catch(error => {
reject(error);
});
}); …Run Code Online (Sandbox Code Playgroud)