Problem
You want to stop injecting content into a Blade section.
And you want the content overwrite to any previous section of the same name.
Solution
Use the Blade @overwrite command.
@section('test')
one
@stop
@section('test')
two
@stop
@yield('test')
The above Blade template will output the following.
one
But if you change the second @stop to an @overwrite.
@section('test')
one
@stop
@section('test')
two
@overwrite
@yield('test')
Then the following is output.
two
Discussion
The @overwrite command is one of the four ways to end a section.
The other three commands are:
