Laravel错误:在null上调用成员函数store()

时间:2018-03-28 04:27:01

标签: laravel file upload

当我尝试发送任何文件时,我收到此消息

它在home.blade.php

中的形式
const app = new App;
app.ui{{ ** Insert Answer ** }}.displayMessage();

它在控制器内的功能

<form action="{{ URL::to('/upload') }}" enctype="multipart/form-data" method="post">
      <input type="file" name="something" >
      {{ csrf_field() }}
      <button type="submit" name="button">Upload</button>
</form>

1 个答案:

答案 0 :(得分:0)

尝试更改此类控制器代码并查看结果:

public function store(Request $request) {
$path = $request->something;
echo $path;  }