Composer View is not loading variable into view

前端 未结 2 678
星月不相逢
星月不相逢 2021-01-12 20:15

I created 3 composer views previously and they all work properly, but then I created another one, which doesn\'t seem to work. I\'ve been trying to get it to work, it doesn\

相关标签:
2条回答
  • 2021-01-12 20:25

    You are doing it wrong, put this code into boot method inside of your provider and also, remove the code from register and remove your method composeEven:

    View::composer(
       'layouts.aklinkosesi', 'App\Http\Composers\EvenComposer'
    );
    
    0 讨论(0)
  • 2021-01-12 20:37

    So here is the solutions which might work for people in same sitatuin. First try these commands:

    composer update
    php artisan config:clear
    php artisan cache:clear 
    composer dumpautoload
    php artisan cache:clear
    

    I tried a few of them than deleted bootstrap/cache/config file and it worked.

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