Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 通过Laravel 5.2注册表更新证明中的参数_Php_Laravel_Composer Php_Laravel 5.2 - Fatal编程技术网

Php 通过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() {

我使用的是标准的Laravel 5.2身份验证

但是我想在我的注册视图中有一些变量可用

我感兴趣的路线是:

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'));
    }


}

我不知道!非常感谢。