我在Laravel 5上有一个项目,我也在办公室和家里工作.它工作正常,但最近在家里它停止工作.Laravel向我展示了两个ErrorException
file_put_contents(G:\project\storage\framework\views/751d8a0fd8a7d4138c09ceb6a34bb377aa2d6265.php):
failed to open stream: No such file or directory
Run Code Online (Sandbox Code Playgroud)
和
file_put_contents(G:\project\storage\framework/sessions/aIXycR4LIAUBVIqZu0T590paOMIpV8vfZGIroEp0):
failed to open stream: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我正在搜索Google的问题决定,并找到有关正确权利的信息.所有的建议都是关于Linux的,但我也在Windows办公室和家里工作.
当我尝试清除应用程序缓存和查看缓存时,工匠与我交谈 - ...清除.但缓存数据和视图存在于存储中.
我该如何解决这个问题?
提前致谢!
我有一个包含一些元素的网页,并且也Ant.design slider存在。滑块值由 React 状态控制。当滑块工具提示打开时,滑块速度非常慢,在控制台中我看到一条消息[Violation] Forced reflow while executing Javascript took ...。
当滑块工具提示关闭时,滑块速度变为正常。如果我只将鼠标指向滑块手柄(不移动手柄),则消息也会出现在控制台中。
如何使用工具提示修复不良行为?提前致谢!
从Laravel 5开始,我感兴趣的是 - 如何在Laravel 5中注册和使用来自包的控制台命令.
如在laracast中讨论https://laracasts.com/discuss/channels/tips/developing-your-packages-in-laravel-5,我创建一个目录结构,将我的包添加到自动加载并创建服务提供者
<?php namespace Goodvin\EternalTree;
use Console\InstallCommand;
use Illuminate\Support\ServiceProvider;
class EternalTreeServiceProvider extends ServiceProvider
{
public function boot()
{
}
public function register()
{
$this->registerCommands();
}
protected function registerCommands()
{
$this->registerInstallCommand();
}
protected function registerInstallCommand()
{
$this->app->singleton('command.eternaltree.install', function($app) {
return new InstallCommand();
});
}
public function provides()
{
return [
'command.eternaltree.install'
];
}
}
Run Code Online (Sandbox Code Playgroud)
我的InstallCommand.php脚本存储在/ src/Console中
<?php namespace Goodvin\EternalTree\Console;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class InstallCommand extends Command {
protected $name = 'install:eternaltree';
protected …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,Laravel 5在ajax请求上随机发送500内部服务器错误(例如,对10个200 OK请求,一个500内部服务器错误请求).CSRF令牌已正确设置:
$(function() {
$.ajaxSetup({
timeout: 3000,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
});
Run Code Online (Sandbox Code Playgroud)
这就是Laravel所说的
如何修复此问题或在代码中找到问题的位置?
我想用我自己的状态消息更改 http 状态标头。例如,更改HTTP/1.1 200 OK为HTTP/1.1 200 custom status message in utf-8。为此,我使用 php 发送了一些标头:
Content-Type: text/html; charset=UTF-8
HTTP/1.1 200 custom status message in utf-8
Run Code Online (Sandbox Code Playgroud)
但是在 Chrome 开发人员工具中,我看到编码错误的状态消息,例如Status Code:200 УпÑ! ЧÑо-Ñо. 有没有可能解决这个问题?
通常,在 Laravel 中验证表单请求时,我们可以使用 $validation->messages() 访问错误。例如:
object(Illuminate\Support\MessageBag)#184 (2) { ["messages":protected]=> array(2) { ["email"]=> array(1) { [0]=> string(40) "The email must be a valid email address." } ["password"]=> array(2) { [0]=> string(41) "The password confirmation does not match." [1]=> string(43) "The password must be at least 6 characters." } } ["format":protected]=> string(8) ":message" }.
Run Code Online (Sandbox Code Playgroud)
是否有一些优雅的方法将对象 MessageBag 转换为示例数组,例如:
[
object({"email" => "The email must be a valid email address."}),
object({"password" => "The password confirmation does not match."})
...
]
Run Code Online (Sandbox Code Playgroud)
PS:如果在 MessageBag 中,任何字段有多个项目,我只想要结果对象数组中的第一项。
提前致谢。