我正在尝试制作一个允许上传文件并将其存储在应用程序的public/upload文件夹中的表单.
我的表格是:
<form action="/image/save" method="post">
<input name="image" type="file" />
<input type="submit" value="Save"/>
</form>
Run Code Online (Sandbox Code Playgroud)
和控制器:
public function save(){
$file = Input::file('image');
$destinationPath = 'upload/';
$filename = $file->getClientOriginalName();
Input::file('image')->move($destinationPath, $filename);
Run Code Online (Sandbox Code Playgroud)
但是当我运行它时,我收到以下错误:调用getClientOriginalName()非对象上的成员函数
我正在使用Atom来开发php,但对我来说,但是我对编辑器有一个问题,我使用One Dark主题,但我尝试更改打开文件的右滚动条的颜色和大小,因为它很小而且很难看我
我尝试这个信息 更改atom-text-editor窗格滚动条颜色
但我没有看到任何变化.
有任何想法吗?谢谢
我正在尝试使用以下两个where子句进行查询:
select * from table1 where `name` = 'paul' AND `id` = 1
Run Code Online (Sandbox Code Playgroud)
在Laravel中有Eloquent,但我不知道正确的语法.
我正在尝试在行结果中使用 avg 和 count 执行查询,如下所示:
SELECT r.id, avg( p.puntuacio ), count(p.puntuacio)
FROM receptes AS r, puntuacio_receptes_usuaris AS p
WHERE r.id = p.recepta_id
GROUP BY r.id
Run Code Online (Sandbox Code Playgroud)
但我不知道我可以在 Laravel 上做什么,因为在 Eloquent 中不能在结果行中写入 avg 或计数。
非常感谢