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
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(){
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire