我想运行这个项目:https : //github.com/adonis-china/adonis-adminify
当我运行时npm install
,存在错误:
> sqlite3@3.1.13 install C:\laragon\www\adonis-admin\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.15.0 (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.15.0 (node-v64 ABI) (falling back to source compile with node-gyp)
gyp ERR! gypfind VS
gyp ERR!ERR! find VSfind VS
msvs_version not set from command …
Run Code Online (Sandbox Code Playgroud) 当我composer install
在命令提示符上运行时,会出现如下错误:
Problem 1
- Installation request for laravel/horizon v1.1.0 -> satisfiable by laravel/horizon[v1.1.0].
- laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp-7.1\php\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个错误?
我的产品型号是这样的:
<?php
...
class Product extends Model
{
...
protected $fillable = ['name','photo','description',...];
public function favorites(){
return $this->morphMany(Favorite::class, 'favoritable');
}
}
Run Code Online (Sandbox Code Playgroud)
我最喜欢的模型是这样的:
<?php
...
class Favorite extends Model
{
...
protected $fillable = ['user_id', 'favoritable_id', 'favoritable_type'];
public function favoritable()
{
return $this->morphTo();
}
}
Run Code Online (Sandbox Code Playgroud)
我的 Laravel 口才是这样的:
$q = $param['q'];
$query = Favorite->where('user_id', auth()->user()->id)
->with('favoritable');
if($q) {
$query->whereHas('favoritable', function ($query) use ($q) {
$query->where('name', 'like', "%$q%");
});
}
$query = $query->paginate(5);
return $query
Run Code Online (Sandbox Code Playgroud)
如果脚本执行,存在这样的错误:
未知列“名称”
我怎么解决这个问题?
我的代码是这样的:
<multiple-photo-product :product="{{ isset($product) ? $product : '' }}"></multiple-photo-product>
Run Code Online (Sandbox Code Playgroud)
代码运行时会引发错误:
语法错误:出现意外的标记}
但是,如果代码是这样的:
<multiple-photo-product product="{{ isset($product) ? $product : '' }}"></multiple-photo-product>
Run Code Online (Sandbox Code Playgroud)
它不会引发错误。
我添加:
,以便将数据作为对象发送。
如果不使用:
,则数据以字符串形式发送。
我该如何解决?
我使用 Laravel 5.3
我的 Laravel 验证是这样的:
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class AddCartRequest extends FormRequest
{
public function rules()
{
return [
'id'=>'required|numeric',
...
'request_date'=>'required'
];
}
}
Run Code Online (Sandbox Code Playgroud)
如果 request_date 的值为
01-08-2017 13:00:00
我想添加这样的条件:
如果请求日期 < 现在 + 5 小时,则会显示消息:“请求日期必须比现在大 5 小时”
我该怎么做?
当我打开Git扩展程序时,结果如下所示:
我试图修复它。我单击修复按钮。但这不是行动。
我得到一些参考:Git:如何将KDiff3配置为合并工具和差异工具。
我这样尝试:
但这行不通。
我怎么解决这个问题?
我正在使用 Laravel 5.6
我插入大数据的脚本是这样的:
...
$insert_data = [];
foreach ($json['value'] as $value) {
$posting_date = Carbon::parse($value['Posting_Date']);
$posting_date = $posting_date->format('Y-m-d');
$data = [
'item_no' => $value['Item_No'],
'entry_no' => $value['Entry_No'],
'document_no' => $value['Document_No'],
'posting_date' => $posting_date,
....
];
$insert_data[] = $data;
}
\DB::table('items_details')->insert($insert_data);
Run Code Online (Sandbox Code Playgroud)
我试图用脚本插入 100 条记录,它有效。它成功插入数据
但是如果我尝试用脚本插入 50000 条记录,它会变得非常慢。我已经等了大约 10 分钟,但没有奏效。存在这样的错误:
504 Gateway Time-out
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?
我尝试这样:
created() {
window.addEventListener('beforeunload', function(event) {
event.returnValue = 'Write something'
this.$router.push('/')
})
},
Run Code Online (Sandbox Code Playgroud)
像这样的消息:
如果我点击取消,它会取消
如果我单击重新加载,它将重新加载页面。它重新加载到详细信息页面
我希望当用户单击重新加载按钮时,它将重新加载页面。但将页面重新加载到主页
我该怎么做?
更新:
我的路由器是这样的:
import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
...
Vue.use(Router)
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [
{
path: '/',
name: 'home',
component: Home
},
...
]
})
Run Code Online (Sandbox Code Playgroud)
我的环境:dev
我的项目正在使用 vuetify
我想忽略该dist
文件夹。所以当dist
文件夹发生变化时,它不会出现在commit
在 .gitignore 文件中,存在/dist
这样的:
.DS_Store
node_modules
/dist
Run Code Online (Sandbox Code Playgroud)
但是为什么有变化的时候还是会出现呢?
我怎么解决这个问题?
laravel ×4
vue.js ×4
laravel-5 ×3
git ×2
laravel-5.6 ×2
vuetify.js ×2
adonis.js ×1
bigdata ×1
composer-php ×1
console ×1
datetime ×1
gitignore ×1
insert ×1
javascript ×1
kdiff3 ×1
laravel-5.3 ×1
laravel-5.5 ×1
node.js ×1
npm ×1
page-refresh ×1
paste ×1
php ×1
polymorphism ×1
required ×1
server ×1
sqlite ×1
validation ×1
vuejs2 ×1