lundi 5 septembre 2016

Laravel Class App\Http\Composers\MainComposer does not exist

I'm new in laravel and i need some help with laravel 5, why is this erro? the error is in Composer class and ComposerServiceProvider enter image description here

MainComposer class

<?php
namespace App\Htt\Composers;
use Illuminate\Contracts\View\View;
use App\Category;


class MainComposer {
    public function compose(View $view){
        $view->with('categories', Category::all());
    }
}



 <?php
namespace App\Providers;
use View; // its saing class View does not exist
use Illuminate\Support\ServiceProvider;
class ComposerServiceProvider extends ServiceProvider{
    public function boot(){
        View::composer('*', 'App\Http\Composers\MainComposer');
    }

    public function register(){

    }

}

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire