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't seem to be something related to my code. I will drop a piece of it here, but I still don't think it's the code.
Provider EvenComposerProvider:
public function register(){
$this->composeEven();
}
public function composeEven(){
view()->composer('includes.aklinkosesi', 'App\Http\Composers\EvenComposer');
}
Composer EvenComposer:
class EvenComposer{
public function compose(View $view){
$view->with('evens', Even::orderBy('id','desc')->paginate(10));
}
}
And than I included the provider inside app.php
App\Providers\EvenComposerProvider::class
When I try to loop through $evens with the foreach, it throws the error:
Undefined variable: evens
My rough guess will be that, Laravel does not compile app.php