php - Laravel 5 InvalidArgumentException 在 FileViewFinder.php 第 137 行 : View [. admin] 未找到

标签 php laravel laravel-5

这是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/

相关文章:

php - Woocommerce 不在目录页面上显示产品描述,但仍显示在单个产品页面中

php - 无法在 PHP 中将数据库获取到对象内的数组

laravel - 方法 Illuminate\View\View::response 不存在

php - UPDATE 查询更新之前设置的所有 TIMEDATE 列

php - 443端口无缘无故附加到主机名

authentication - Laravel 4 中的角色特定登录

validation - Laravel 验证规则的关键

Laravel C面板错误:SQLSTATE[HY000] [1045] Access denied for user 'homeimpr_clranke' @'localhost' (using password: YES)

php - Laravel 环境困惑

javascript - 如何在 Laravel 5 的页面上按当前表格打印数据?