Solution:1
If you’re using @extends
in your content layout you can use this:
@extends('master', ['title' => $title])
Note that same as above works with children, like:
@include('views.subView', ['my_variable' => 'my-value'])
Usage
Then where variable is passed to, use it like:
<title>{{ $title ?? 'Default Title' }}</title>