Seems correct to me, since you have cached Channel::all forever ?
Jul 31, 2018
13
Level 3
after migrate:refresh, always have to run cache:clear to see the view composer data
Everytime I run "migrate:refresh", I always then have to run "cache:clear" to see the view composer data, in this case the "channels":
AppServierProvider.php :
public function boot()
{
\View::composer('*', function ($view){
$channels = \Cache::rememberForever('channels', function (){
return Channel::all();
});
$view->with('channels', $channels);
});
After "migrate:refresh" and with tinker "factory('App\Thread', 30)->create();", I don't see the channels.
I have to run "cache:clear". The instructor (Jeffrey), does not run "cache:clear".
Level 3
Solution was to start the migrations from scratch : migrate:fresh instead of migrate:refresh
Please or to participate in this conversation.