Php 通过Laravel 5.2注册表更新证明中的参数
我使用的是标准的Laravel 5.2身份验证 但是我想在我的注册视图中有一些变量可用 我感兴趣的路线是:Php 通过Laravel 5.2注册表更新证明中的参数,php,laravel,composer-php,laravel-5.2,Php,Laravel,Composer Php,Laravel 5.2,我使用的是标准的Laravel 5.2身份验证 但是我想在我的注册视图中有一些变量可用 我感兴趣的路线是: Route::get('register', 'Auth\AuthController@showRegistrationForm'); showRegistrationForm方法是在名为RegisterUsers的特征中创建的,该特征位于Illumb\Foundation\Auth中 public function showRegistrationForm() {
Route::get('register', 'Auth\AuthController@showRegistrationForm');
showRegistrationForm方法是在名为RegisterUsers的特征中创建的,该特征位于Illumb\Foundation\Auth
中
public function showRegistrationForm()
{
if (property_exists($this, 'registerView')) {
return view($this->registerView);
}
return view('auth.register');
}
我可以在这里简单地传递参数,但问题是该文件位于供应商目录中,因此当我运行Composer Update时,我的更改将被覆盖&我的网站将崩溃。是否有一种防更新的方法可以做到这一点?您可以在AuthController中覆盖该方法:
class AuthController extends Controller
{
....
public function showRegistrationForm()
{
$data = ['foo', 'bar'];
if (property_exists($this, 'registerView')) {
return view($this->registerView, compact('data'));
}
return view('auth.register', compact('data'));
}
}
我不知道!非常感谢。