我按照https://getcomposer.org/doc/00-intro.md#globally上的文档在arch linux上全局安装composer.当我这样做时composer self-update,我得到这样的信息:
[ErrorException]
rename(/home/hannes/.composer/cache/composer-temp.phar,/usr/local/bin/composer): Permission denied
Run Code Online (Sandbox Code Playgroud)
权限/usr/local/bin/(我将它们更改为777,但没有帮助):
-rwxrwxrwx 1 hannes users 1104202 30. Mai 18:07 composer
Run Code Online (Sandbox Code Playgroud)
在我的主目录中,我这样做了:
sudo chmod -R 777 .composer/
Run Code Online (Sandbox Code Playgroud)
在/etc/php/php.ini,open_basedir看起来如此:
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/local/bin/
Run Code Online (Sandbox Code Playgroud)
我也试过sudo composer self-update但它没有用,可能不是正确的方法.(?).还有什么我可以尝试使这项工作?
我收到了laravel 5的错误消息,我不明白.
Next exception 'ErrorException' with message 'File build/css/all.css not
defined in asset manifest.
Run Code Online (Sandbox Code Playgroud)
我没有安装任何资产管道或其他东西.只是使用elixir来编译,缩小和版本化scss文件all.css并将其包含在主视图中<link rel="stylesheet" href="{{ elixir("css/all.css") }}">
什么是"资产清单"以及如何解决这个错误?`
我使用laravel 5.1.6的包含身份验证,并想知道如何扩展它,工作方式如下:
if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) {
// The user is active, not suspended, and exists.
}
Run Code Online (Sandbox Code Playgroud)
如果用户不是"活动",则无法登录.我在users表中有一个'active'列,其值为0或1.如何在使用内置身份验证和登录throtteling的同时执行此操作.
编辑:
我在AuthController中没有postLogin函数,只有a use AuthenticatesAndRegistersUsers, ThrottlesLogins;,a __construct(),a validator()和create()函数.我是否必须更改特征中的某些内容,Illuminate\Foundation\Auth\..或者我必须postLogin()在AuthController中添加该函数吗?
我使用gulp和laravel elixir来建立一个网站.每次我gulp或gulp --production在我的编辑器(geany)中,都会弹出3个桌面通知.(侏儒3.18.2).当我gulp watch发出通知时也会出现.
我可以禁用这些消息还是只让它们出现在终端中?
在laravel 4中,我曾经有过在多个视图中使用的HTML宏,例如:
HTML::macro('minipics', function($pic)
{
//
}
Run Code Online (Sandbox Code Playgroud)
为此我在macros.php文件/app夹中有一个文件.我无法找到将宏放在laravel 5的哪个位置.我应该使用'macroable'功能吗?
我最终使用@include(),给它所需的值.
@include('shared.minipics', $mpics = $ppics)
@include('shared.minipics', $mpics = $randpics)
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Diesel查询MySQL数据库并使用带有Rocket的Handlebars模板显示结果.
我在models.rs中有这个
#[derive(Queryable, Serialize)]
pub struct Post {
pub id: i32,
pub title: String,
pub text: String,
pub published: bool,
}
Run Code Online (Sandbox Code Playgroud)
cargo run 输出:
--> src/main.rs:69:5
|
69 | Template::render("index", &results)
| ^^^^^^^^^^^^^^^^ the trait `serde::ser::Serialize` is not implemented for `tasty::models::Post`
|
= note: required because of the requirements on the impl of `serde::ser::Serialize` for `std::vec::Vec<tasty::models::Post>`
= note: required by `rocket_contrib::Template::render`
Run Code Online (Sandbox Code Playgroud)
在我的Cargo.toml中,我有这个:
[dependencies]
chrono = "0.3.0"
rocket = "0.2.8"
rocket_codegen = "0.2.8"
serde = …Run Code Online (Sandbox Code Playgroud) 我想知道在laravel 5.1中使用Facades和helper方法之间是否存在性能差异.
我首先要删除,use View;或者View::make()尽可能地删除,认为这view()会更简单,也可能更快.但我不知道.
与Redirect::to()- > redirect(),Redirect::back()- > back()等相同..
是否存在差异或无关紧要?
我在mysql text字段中有此数据:
{"message":"New comment from pp on one of your photos.","action":"\/photos\/9372"}
Run Code Online (Sandbox Code Playgroud)
使用此功能(laravel通知)将其写入数据库:
public function toArray($notifiable)
{
return [
'message' => 'New comment from '.Auth::user()->username.' on one of your photos.',
'action' => '/photos/'.$this->comment->photo_id
];
}
Run Code Online (Sandbox Code Playgroud)
该文件说:
"The returned array will be encoded as JSON and stored in the data column of your notifications table."
Run Code Online (Sandbox Code Playgroud)
然后我像这样获取数据:
$notifications = Auth::user()->notifications()->paginate(30);
return view('home.index')->with('notifications',$notifications);
Run Code Online (Sandbox Code Playgroud)
如何json array在刀片视图中显示此(?)的内容?我可以var_dump(),但不能显示。总是undefinded index或其他错误。
@forelse($notifications as $n)
@php
$data = $n->data;
@endphp
{!! …Run Code Online (Sandbox Code Playgroud) 我有一个最大高度的div和里面的图像,应该使用max-width:100%和max-height:100%.在chrome中,这可行,但firefox仅使用max-width并忽略max-heigth.
div#overlaycontent{
position:relative;
overflow:hidden;
height:100%;
overflow-y:auto;
}
div#pic{
overflow:hidden;
position:relative;
box-sizing:border-box;
float:right;
width: -moz-calc(100% - 250px);
width: -webkit-calc(100% - 250px);
width: -o-calc(100% - 250px);
width: calc(100% - 250px);
max-height:90%;
}
img#zoompic{
max-width:100%;
max-height:100%;
display:block;
}
Run Code Online (Sandbox Code Playgroud)
我如何实现firefox将同时使用?最大宽度和最大高度?
我想显示按日期分组的照片。它可以工作,但只能使用两个查询并且没有分页。有没有一种方法可以使用 laravel paginate() 仅使用一个查询来完成此操作?我需要最近 5 天的数据(仅限那些有图片的数据),然后每页始终需要 5 天的数据。
问题是,我想对日子进行分页,而不是对图片进行分页。
$days = Pic::select(DB::raw('DATE(created_at) as datum'))
->distinct()
->orderBy('datum','desc')
->take(5)
->get();
$daysarray = array();
foreach($days as $day)
{
$pics = Pic::where(DB::raw('DATE(created_at)'),'=',$day->datum)
->orderBy('id','desc')
->get();
$daysarray[$day->datum] = $pics;
}
Run Code Online (Sandbox Code Playgroud) 我已经要求并安装了"illuminate/html":"~5.0",如下所示:http://laravel.com/docs/5.0/upgrade并将其添加到"提供者"和"别名"中.
问题是,我仍然得到:
FatalErrorException in 65ad332c3ff984a4112203ba0538718c line 23:
Class 'HTML' not found
Run Code Online (Sandbox Code Playgroud)
我也尝试use Html;在控制器中"制作"视图和视图本身,但它没有帮助.我必须use在某个地方,或者它可能是什么,我做错了吗?
我需要这个来使用Html宏.
编辑:
似乎现在工作.我不得不Html在视图中使用而不是HTML
laravel-5 ×5
php ×4
gulp ×2
laravel ×2
assets ×1
blade ×1
composer-php ×1
css ×1
firefox ×1
group-by ×1
json ×1
laravel-4 ×1
laravel-5.3 ×1
linux ×1
macros ×1
pagination ×1
performance ×1
permissions ×1
rust ×1
serde ×1
templating ×1