i created a new folder ViewComposers and added a new file ViewComposer.php. Path = App/Http/ViewCompers/ViewComper.php
Below is my code
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ViewComposer extends ServiceProvider{
public function boot(){
view()->composer('*', function (View $view) {
$view->with('new_thread_comment_count', '50');
});
}
and in my config\app.php i have added
'App\Providers\ViewComposer',
and i have also run composer dump-autoload. But i still received FatalErrorException in ProviderRepository.php line 146: Class 'App\Providers\ViewComposer' not found.
Did i miss out anything?