Menu
About LCS
View - View Composer
Sometimes, same data needs to be bound to a view of multiple routes and controllers each time it is rendered. View composers helps to do that. So, basically, It is a class method that is run when view is rendered.
Using view composer for sending seo meta title to layout file
Step 01: Creating view composer file in App\View\Composers directory with name MetaComposer.php namespace App\View\Composers;use App\Models\Post; use Illuminate\View\View; class MetaComposer {...
Category:
View
3 years ago