I created 3 compositional views earlier, and they all work fine, but I created another one that doesn't seem to work. I tried to get it to work for 3 days, and this does not seem to be related to my code. I will drop a piece of it here, but I still don't think this is 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 how did I app.php provider inside app.php
App\Providers\EvenComposerProvider::class
When I try to execute the $evens loop using foreach, it throws an error:
Undefined variable: evens
My gross assumption would be that Laravel is not compiling app.php
source share