Laravel 5 InvalidArgumentException in FileViewFinder.php line 137: View [.admin] not found

后端 未结 7 1073
野趣味
野趣味 2021-02-19 07:32

This is student.php and my function for admin:

 public function admin(Request $request){

       if($request->isMethod(\'get\')){
       retu         


        
相关标签:
7条回答
  • 2021-02-19 07:40

    I had the same problem because I had a backslash \, the solution was change it to slash:

    return \View::make('folder/admin');
    
    0 讨论(0)
  • 2021-02-19 07:48

    If any of the answers above do not work. why don't you try modifying the name of config.php project/bootstrap/cache/config.php to another name like config.php.old it worked for me with laravel 5.3

    0 讨论(0)
  • 2021-02-19 07:52

    You don't want to reference your views beginning with a slash.

    This:

    return \View::make('/admin');

    Should look like:

    return \View::make('admin');

    0 讨论(0)
  • 2021-02-19 07:53

    If you recently deployed you project to your production server or moved the project to another server, do not forget to clear the app cache by running these commands.

    php artisan cache:clear
    php artisan view:clear
    php artisan config:cache
    

    it should fix it.

    Also consider updating your .env file to match new environment variables.

    0 讨论(0)
  • 2021-02-19 07:59

    A view should an extension .blade.php.

    So your file that has the admin form should have the name admin.blade.php

    Note :

    If you have the view under any sub directory like somefolder/admin.blade.php

    Then you should do like this

    return \View::make('somefolder/admin');

    Learn more about templating here :)

    0 讨论(0)
  • 2021-02-19 08:00

    Laravel has an authentication skeleton generator which might have been previously used prior to your current state in your project. I had this error and I was coming from a git clone that had Laravel extra's omitted from sharing good practices.

    By reissuing the command

    php artisan make:auth
    

    https://laravel.com/docs/5.6/authentication#introduction

    0 讨论(0)
提交回复
热议问题