这是student.php和我的管理员功能:
public function admin(Request $request){
if($request->isMethod('get')){
return \View::make('/admin');
}
else
{
$UserData['email'] = Input::get('username');
$UserData['password'] = Input::get('password');
User::create($UserData);
return 'admintest';
//return Redirect::to('/view');
}
}
routes.php
Route::match(['get', 'post'], '/admin', 'student@admin');
这是管理表单:
{!! Form::open(array('url' => '/admin')) !!}
<input type="hidden" name="_token" value="{{ csrf_token() }}">
User Name:<br />
<input name="username" type="text" id="username" size="40" />
<br /><br />
Password:<br />
<input name="password" type="password" id="password" size="40" />
<br />
<br />
<br />
<input type="submit" name="button" id="button" value="Log In" />
{!! Form::close() !!}
不知道为什么显示错误:
InvalidArgumentException in FileViewFinder.php line 137: View [.] not found
最佳答案
如果您最近将项目部署到生产服务器或将项目移动到另一台服务器,请不要忘记通过运行这些命令来清除应用缓存。
php artisan cache:clear
php artisan view:clear
php artisan config:cache
应该可以解决这个问题。
另请考虑更新您的 .env
文件以匹配新的环境变量。
关于php - Laravel 5 InvalidArgumentException 在 FileViewFinder.php 第 137 行 : View [. admin] 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31262069/