你可能会看到我对laravel很新.我遇到了一个似乎无法看到我所制作的新课程的问题......
首先我跑了....
php artisan make:request CreateSongRequest
Run Code Online (Sandbox Code Playgroud)
然后在app/Http/Requests /中生成CreateSongRequest.php文件
内容...
<?php namespace App\Http\Requests;
use App\Http\Requests\Request;
class CreateSongRequest extends Request {
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}
Run Code Online (Sandbox Code Playgroud)
在我的控制器中,我有以下方法的表格帖子......
public function store(CreateSongRequest $request, Song $song) {
$song->create($request->all());
return redirect()->route('songs_path');
}
Run Code Online (Sandbox Code Playgroud)
当我提交表单时,我收到以下错误...
RouteDependencyResolverTrait.php第53行中的ReflectionException:类App\Http\Controllers\CreateSongRequest不存在
归档时间: |
|
查看次数: |
10132 次 |
最近记录: |