我只是想问一下如何在Windows机器(我的本地机器)上使用它的任务调度功能.
我已经阅读了它的文档,我注意到它正在使用Cron.
真的很感激任何帮助.
在laravel进行注册我在Laravel中使用加密算法来代替内置的bcrypt函数,因为获取密码并在忘记密码时将其发送到邮件.
但解密它显示的错误就像
DecryptException The MAC is invalid in Encrypter.php (line 184)
Run Code Online (Sandbox Code Playgroud)
这个,当我运行这个代码时,它正在本地工作但服务器本身它不工作下面我已经提到代码,任何人都可以请帮助
public function forgotpassword(Request $request)
{
$email=$request->email;
$selectemail = User::select('email','password','name')
->where('email',$email)
->first();
if($selectemail)
{
$password=decrypt($selectemail->password);
$data = array( 'email' => $selectemail->email,'password' => $password , 'name' => $selectemail->name);
Mail::send('email.resetpassword',$data,function($message) use ($email)
{
$message->to([$email])->subject('Forgot Password Letgo');
});
echo "Mail has sent successfully";
} else {
echo "This email is not yet registered";
}
}
Run Code Online (Sandbox Code Playgroud) 我已经在Laravel的Web应用程序中工作,需要用户之间的评级系统.所以,我一直在阅读Laravel文档以及这里和那里的一些帖子,但我一直想知道哪个是完成我想要做的最好的方法.我无法决定接下来的两个选项.
我目前的表是:
用户(id)| 费率(身份证,寄件人,评论,费率)| user_rate(id,user_id,rate_id)
我目前的用户型号:
public function rates_sent(){
return $this->hasMany(Rate::class,"sender");
}
public function rates(){
return $this->belongsToMany(Rate::class);
}
Run Code Online (Sandbox Code Playgroud)
我目前的费率型号:
public function sender(){
return $this->belongsTo(User::class,"sender");
}
public function receiver(){
return $this->belongsToMany(User::class);
}
Run Code Online (Sandbox Code Playgroud)
第二种选择是:
用户(id)| 费率(身份证,发件人,收件人,评论,费率)
用户模型:
public function rates_sent(){
return $this->hasMany(Rate::class,"sender");
}
public function rates_received(){
return $this->hasMany(Rate::class,"receiver");
}
Run Code Online (Sandbox Code Playgroud)
费率模型:
public function sender(){
return $this->belongsTo(User::class,"sender");
}
public function receiver(){
return $this->belongsTo(UseR::class,"receiver");
}
Run Code Online (Sandbox Code Playgroud)
那么,这两个都是好的解决方案 一种选择比另一种更容易接受吗?还有另一个更好的选择吗?
为我的坏事道歉.提前致谢
我从上载我laravel项目local来host。现在我有以下错误:
Fatal error: require(): Failed opening required '/home/httpd/vhosts/mort.com/httpdocs/cucc/testLaravel/vendor/composer/../../app/Libraries/helpers.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/httpd/vhosts/mort.com/httpdocs/cucc/testLaravel/vendor/composer/autoload_real.php on line 66`
Run Code Online (Sandbox Code Playgroud)
我无法理解问题是什么。Laravel 框架位于名为testLaravel名为laravel.
我正在使用Python 3和GTK3开发桌面应用程序.
我需要一个按钮来改变悬停时的背景颜色,可以这样做:
self.uploadbutton.modify_bg(Gtk.StateType.PRELIGHT, self.color)
Run Code Online (Sandbox Code Playgroud)
到目前为止,我定义了一个与我自己的主题相匹配的RGB颜色,但是由于我必须发布此代码,我想将该颜色更改为已建立的主题颜色之一.
在网上搜索,我发现有一种方法可以用GTK2来实现,但是从GTK的3.8版开始,该gtk-color-scheme属性已被弃用.
有没有其他方法来尊重用户主题颜色而不使用此属性?
我想改变div边框的颜色,以便颜色每秒都会改变为另一种颜色.
我不知道怎么做,有什么帮助吗?这是我的代码.
/* Style the links inside the list items */
ul.topnav li a {
display: inline-block;
border-left: 3px solid;
border-left-color: #FF0000;
border-top-color: #F5FF00;
border-top-style: double;
border-bottom: 3px solid;
border-bottom-color: #FF0000;
border-right-style: double;
border-right-color: #F5FF00;
border-radius: 40px;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
transition: 0.3s;
font-size: 17px;
}Run Code Online (Sandbox Code Playgroud)
<header>
<ul class="topnav" id="drop">
<li><a class="selected" href="home.html">Home</a></li>
<li>
<a href="project.html">Project</a>
<ul>
<li><a href="project.html">Algemeen</a></li>
<li><a href="test.html">test</a></li>
<li><a href="test2.html">test2</a></li>
</ul>
</li>
<li><a href="contact.html">Contact</a></li>
<li class="icon">
<a href="javascript:void(0);" onclick="myFunction()">☰</a>
</li>
</ul>
</header>Run Code Online (Sandbox Code Playgroud)
我多次安装了laravel 5.4.现在我正在尝试使用相同的命令安装laravel 5.5并且它不起作用.
composer create-project --prefer-dist laravel/laravel blog dev-develop
Run Code Online (Sandbox Code Playgroud)
它似乎没有任何安装错误,只有很多建议.但是没有生成密钥,也没有创建.env文件.当我尝试制作php artisan key:generate
/public_html/blog/.env): failed to open stream: No such file or directory
Run Code Online (Sandbox Code Playgroud) 我有下一个收藏:
Collection {#356 ?
#items: array:31 [?
0 => {#359 ?
+"id": 17
+"zone_id": 2
+"name_de": "Österreich"
+"name_en": "Austria"
+"name_iso": "AUSTRIA"
+"tld": "at"
+"iso3166": "AT"
+"phone": 43
+"vat_regex": "/^U[0-9]{8}$/"
+"shop_id": 17
+"country_id": 165
}
1 => {#360 ?
+"id": 2
+"zone_id": 2
+"name_de": "Belgien"
+"name_en": "Belgium"
+"name_iso": "BELGIUM"
+"tld": "be"
+"iso3166": "BE"
+"phone": 32
+"vat_regex": "/^[01][0-9]{9}$/"
+"shop_id": 17
+"country_id": 25
}]
}
Run Code Online (Sandbox Code Playgroud)
我想获得下一个结果作为关联数组:
[
"AT" => "Austria",
"BE" => "Belgium"
]
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用:
$keyed = $countries->map(function ($item) {
return [$item->iso3166 => …Run Code Online (Sandbox Code Playgroud) 我可能正在做一些非常愚蠢的事情。不小心产生了一段代码,我似乎无法弄清楚它是如何工作的。
我正在尝试自定义未经身份验证的用户重定向到登录页面。因此,当用户尝试访问受保护的页面时,laravel 会将用户重定向到登录页面。在这种情况下,我试图显示 Javascript toastr 消息。
我所做的是自定义类中的unauthenticated方法App\Exceptions\Handler.php如下:
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}
//dd($request);
return redirect()->guest('login')->withError('You are not logged in or Your session has expired');
}
Run Code Online (Sandbox Code Playgroud)
请注意,我错过s了withError函数中的 。在我的刀片文件中,我显示的 toastr 通知如下:
<script>
@if(Session::has('error'))
toastr.error("{{Session::get('error')}}");
@endif
</script>
Run Code Online (Sandbox Code Playgroud)
因此,每当用户因为尚未登录而被重定向到登录页面时,就会显示 Java Script toastr 消息。但是,我无法弄清楚该Session('error')函数是如何填充该值的withError。我只能发现 Laravel 有withErrors函数,没有withError.
试图在过去几个小时内排除故障,但运气不佳。在这里寻求一些指导。谢谢。顺便说一句,我对 Laravel 很陌生。
我试图将5个div放在一个圆形div周围,我该怎样才能实现呢?
到目前为止这是我的代码:
.main{
border: 2px dotted #000000;
border-radius: 50%;
width: 500px;
height: 500px;
}
.cirlce1{
height: 50px;
width: 50px;
border: 2px dotted #000000;
border-radius: 50%;
top: 50px;
}
.cirlce2{
height: 50px;
width: 50px;
border: 2px dotted #000000;
border-radius: 50%;
top: 50px;
}Run Code Online (Sandbox Code Playgroud)
<div class="main">
<div class="cirlce1"></div>
<div class="cirlce2"></div>
</div>Run Code Online (Sandbox Code Playgroud)
我希望我的输出像
谢谢.
laravel ×6
php ×3
css ×2
html ×2
collections ×1
composer-php ×1
gtk ×1
gtk3 ×1
javascript ×1
jquery ×1
laravel-5 ×1
laravel-5.2 ×1
laravel-5.3 ×1
laravel-5.4 ×1
laravel-5.5 ×1
pygtk ×1
python ×1
python-3.x ×1