Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Master/fixed layout in Laravel.

@yield(“Parameter”) :- It is a section which requires to be filled in by your view which extends the layout. You could pass it a default value through the second parameter if you’d like.

@section(“Parameter”):- It is a section which is used to fill HTML content in view to extends the layout.

Below example is master layout program, in which all content is fixed but title and body are dynamic which is extend by other view.

Below program is product.blade.php page which extends master layout and assigns title and body as required.

After that, we have to declare a function in the controller so that it returns the address of view. See below:-

After that, we have to route the controller and function into web.php. See the below image:-

Now run the server and copy the address and add products in it and hit enter. See the output below:-