Laravel view not found exception

前端 未结 16 1680
遇见更好的自我
遇见更好的自我 2020-11-29 03:44

I have problem with laravel view is not found by route function I did composer dumpautoload but no use ArticleController.php



        
相关标签:
16条回答
  • 2020-11-29 03:55

    If your path to view is true first try to config:cache and route:cache if nothing changed check your resource path permission are true.

    example: your can do it in ubuntu with :

    sudo chgrp -R www-data resources/views
    sudo usermod -a -G www-data $USER
    
    0 讨论(0)
  • 2020-11-29 03:59

    I was having the same error, but in my case the view was called seeProposal.

    I changed it to seeproposal and it worked fine...

    It was not being an issue while testing locally, but apparently Laravel makes a distinction with capital letters running in production. So for those who have views with capital letters, I would change all of them to lowercase.

    0 讨论(0)
  • 2020-11-29 04:00

    Somewhat embarrassingly, I discovered another rather trivial cause for this error: I had a full stop in the filename of my blade file (eg resources/views/pages/user.invitation.blade.php). It really did make sense at the time!

    I was trying to reference it like so: view('pages.user.invitation')

    but of course Laravel was looking for the file at resources/views/pages/user/invitation.blade.php and throwing the view not found.

    Hope this helps someone.

    0 讨论(0)
  • 2020-11-29 04:02

    In my case, Laravel 5.3

    Route::get('/', function(){
        return View('test');
    });
    

    test.blade.php was not rendering but some other views were rendering on localhost via XAMPP on mac. Upon running artisan server, the view started rendering for same url over XAMPP.

    php artisan serve
    

    To avoid any such scenario, one should test the Laravel apps with artisan server only.

    0 讨论(0)
  • 2020-11-29 04:04

    In my case I was calling View::make('User/index'), where in fact my view was in user directory and it was called index.blade.php. Ergo after I changed it to View@make('user.index') all started working.

    0 讨论(0)
  • 2020-11-29 04:04

    In my case I had to run php artisan optimize:clear in order to make everything to work again.

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