Laravel Passing Variable from Child Blade Template to Master Blade Template

Laravel passing variable from child blade template to master blade template

In Laravel passing variable from child blade template to master blade template, first we need to pass a variable where the child blade extending master blade by array type. Then we can use that variable in master blade for example refer below code

step 1: in Resource/views/Layout/app.blade.php

step 2: in Resource/views/Auth/login.blade.php

step 3: in Resource/views/Auth/register.blade.php