我需要从像这样的字符串中提取电子邮件地址(我正在创建一个日志解析器):
<some text> from=someuser@somedomain.com, <some text>
与egrep(或grep -Eo).所以字符串只需要在"from="和之间拉出",",因为日志的其他部分也包含电子邮件地址,比如to=和etc
我有两个网站运行相同的 laravel 5.5 项目。事实上,这两个网站都托管在同一台服务器上。其中一个有效,另一个有队列问题。我已经仔细检查了一切。
.env:
...
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=database
QUEUE_DRIVER=database
...
Run Code Online (Sandbox Code Playgroud)
conf/queue.php
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
Run Code Online (Sandbox Code Playgroud)
我也有空jobs桌子。每当我尝试运行队列时,我都会收到错误消息
php artisan queue:work --daemon
In QueueManager.php line 172:
No connector for []
Run Code Online (Sandbox Code Playgroud) 我使用 nuxtjs 2.10.x 和 i18n 模块。Nu 自定义中间件或类似的东西。路由工作正常。
我的nuxt.config.js模块/i18n 部分:
...
modules: [
'@nuxtjs/axios',
'@nuxtjs/pwa',
'@nuxtjs/auth',
'@nuxtjs/dotenv',
'nuxt-fontawesome',
[
'nuxt-i18n',
{
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en.json',
name: 'English'
},
{
code: 'zh',
iso: 'zh-CN',
file: 'zh.json',
name: '????'
}
],
lazy: true,
langDir: 'locales/',
defaultLocale: 'en',
strategy: 'prefix_except_default',
differentDomains: false,
vueI18n: {
fallbackLocale: 'en'
},
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'lang'
}
}
]
],
...
Run Code Online (Sandbox Code Playgroud)
页面文件夹结构:
'pages/'
|--'contact_us.vue'
|--'_lang/'
|--'contact_us.vue'
Run Code Online (Sandbox Code Playgroud)
但我收到了这个疯狂的警告:[vue-router] Route with …
我使用 Nuxt js + veeValidate 3.x
我的插件看起来像这样:
import Vue from 'vue'
import {
ValidationObserver,
ValidationProvider,
extend
} from 'vee-validate'
import { required, email, min, confirmed } from 'vee-validate/dist/rules'
extend('required', {
...required,
message: 'This field is required'
})
extend('email', email)
extend('min', min)
extend('confirmed', confirmed)
Vue.component('ValidationProvider', ValidationProvider)
Vue.component('ValidationObserver', ValidationObserver)
Run Code Online (Sandbox Code Playgroud)
作为插件添加到nuxt.config.js plugins: [{ src: '~/plugins/vee-validate.js', ssr: false }, ..
模板中,如下所示:
<ValidationObserver ref="registrationForm">
<ValidationProvider rules="required|email" name="Email Address" v-slot="{ errors }">
<div>
<input type="text" v-model.lazy="user.email"/>
<span class=form-errors">{{ errors[0] }}</span>
</div>
</ValidationProvider>
</ValidationObserver>
Run Code Online (Sandbox Code Playgroud)
验证以这种方式完美运行:
methods: …Run Code Online (Sandbox Code Playgroud) 我在互联网上找到的样本中创建了一张表格.该列的定义stored是:
stored | timestamp without time zone | default '2014-04-11 21:19:20.144487'::timestamp without time zone
Run Code Online (Sandbox Code Playgroud)
如何将此更改为"正常"时间戳now()类型?那么它会在插入数据时标记当前的日期时间?
谢谢大家!
我有一个Orders有hasOne关系的模型participant。
public function participant()
{
return $this->hasOne('App\OrderParticipant', 'order_id');
}
Run Code Online (Sandbox Code Playgroud)
我需要检索Orders排序依据participant.last_name
我的方法
$orders = \App\Orders::with(['participant',])
->where('user_id', $user->id)
->orderBy('participant.last_name')
->get();
Run Code Online (Sandbox Code Playgroud)
失败:
未定义的表:7错误:缺少表\“参与者\” \ nLINE的FROM子句条目:... 1
收集后我已经尝试对它进行排序
return $orders->sortBy('participant.last_name');
Run Code Online (Sandbox Code Playgroud)
但这根本没有排序
顺便说一句我正在使用postgres
谢谢。
laravel-5 ×2
nuxt.js ×2
php ×2
bash ×1
grep ×1
laravel ×1
laravel-5.7 ×1
nuxt-i18n ×1
postgresql ×1
regex ×1
timestamp ×1
vee-validate ×1
vue.js ×1