@yield and @section
@yield is just a shorthand for a @section. For @yield, it always gets the section from the child layout. That means it always overrides the @yield part, even if it has a default defined as @yield('section', 'Default Content')
So when the Laravel executes your blade file, it first checks if you have extended a master layout, if you have extended one, then it shifts to the master layout and starts executing and if found @yield then it shifts to the child layout and again it comes back to the master. And of course, finally, it parses the blade format to raw PHP and gives the output in html
@include is similar to PHP's include() function, but it still can have @sections inside. The main difference between @yield and @include is: @include defines view to inject into parent. @yield defines section to be injected. @yield works only if your view @extends the parent view.
@show and @parent
@show is a blade directive that is used with @section, blade parse if you want to show this as section that have a default content.
If you already have a @section defined in the master layout, it will be overridden unless you specify @parent inside the child layout's @section.
Using just @yield() you wont be able to have a default content. Using @section()..@show you'll be able to have a default content and you can do stuff like this.
<p>This is the sidebar</p>
<p>This is apended text</p>
-University Management System
Home-University Management System