在 blade 模板中定义了一个变量, 如何在继承该模板的 blade 文件中使用 ?
// 父模板: laryout.blade.php
<!doctype html>
<html>
<head>
<title>Document</title>
</head>
<body>
{{ $variable = 'abccd' }}
<div class="container">
@yield('content')
</div>
</body>
</html>
// 子 blade.php
@extends('layout.php')
@section('content')
{{ $variable }} // 报错, 找不到变量
@endsection
在 AppServiceProvider 中
见文档: 视图 -- 与所有视图共享数据