如何在表单寄存器(laravel generator infyom)中添加一些文本字段?

我在这里阅读教程: http : //labs.infyom.com/laravelgenerator/docs/5.3/installation

我克隆pipe理员生成器: https : //github.com/InfyOmLabs/adminlte-generator/tree/5.3

我在我的本地主机访问它。 registry格是这样的: https : //postimg.org/image/5gswtx4gn/

我想添加一些文本字段和combobox。 如级别,级别,用户名等

当我访问代码时,我很困惑代码是这样的:

控制器寄存器是这样的:

<?php namespace App\Http\Controllers\Auth; use App\User; use Validator; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\RegistersUsers; class RegisterController extends Controller { use RegistersUsers; protected $redirectTo = '/home'; public function __construct() { $this->middleware('guest'); } protected function validator(array $data) { return Validator::make($data, [ 'name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|min:6|confirmed', ]); } protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), ]); } } 

它是供应商中的加载注册用户。 就像这样:

 <?php namespace Illuminate\Foundation\Auth; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Auth\Events\Registered; trait RegistersUsers { use RedirectsUsers; public function showRegistrationForm() { return view('auth.register'); } public function register(Request $request) { $this->validator($request->all())->validate(); event(new Registered($user = $this->create($request->all()))); $this->guard()->login($user); return $this->registered($request, $user) ?: redirect($this->redirectPath()); } protected function guard() { return Auth::guard(); } protected function registered(Request $request, $user) { // } } 

注册视图是这样的:

 <div class="register-box-body"> <p class="login-box-msg">Register a new membership</p> <form method="post" action="{{ url('/register') }}"> {!! csrf_field() !!} <div class="form-group has-feedback{{ $errors->has('name') ? ' has-error' : '' }}"> <input type="text" class="form-control" name="name" value="{{ old('name') }}" placeholder="Full Name"> <span class="glyphicon glyphicon-user form-control-feedback"></span> @if ($errors->has('name')) <span class="help-block"> <strong>{{ $errors->first('name') }}</strong> </span> @endif </div> <div class="form-group has-feedback{{ $errors->has('email') ? ' has-error' : '' }}"> <input type="email" class="form-control" name="email" value="{{ old('email') }}" placeholder="Email"> <span class="glyphicon glyphicon-envelope form-control-feedback"></span> @if ($errors->has('email')) <span class="help-block"> <strong>{{ $errors->first('email') }}</strong> </span> @endif </div> <div class="form-group has-feedback{{ $errors->has('password') ? ' has-error' : '' }}"> <input type="password" class="form-control" name="password" placeholder="Password"> <span class="glyphicon glyphicon-lock form-control-feedback"></span> @if ($errors->has('password')) <span class="help-block"> <strong>{{ $errors->first('password') }}</strong> </span> @endif </div> <div class="form-group has-feedback{{ $errors->has('password_confirmation') ? ' has-error' : '' }}"> <input type="password" name="password_confirmation" class="form-control" placeholder="Confirm password"> <span class="glyphicon glyphicon-lock form-control-feedback"></span> @if ($errors->has('password_confirmation')) <span class="help-block"> <strong>{{ $errors->first('password_confirmation') }}</strong> </span> @endif </div> <div class="row"> <div class="col-xs-8"> <div class="checkbox icheck"> <label> <input type="checkbox"> I agree to the <a href="#">terms</a> </label> </div> </div> <!-- /.col --> <div class="col-xs-4"> <button type="submit" class="btn btn-primary btn-block btn-flat">Register</button> </div> <!-- /.col --> </div> </form> <a href="{{ url('/login') }}" class="text-center">I already have a membership</a> </div> 

我想问,如何在表单上添加文本框和combobox来注册? 我很困惑。 因为从供应商调用的注册视图(Illuminate \ Foundation \ Auth \ RegistersUsers)

如果你想添加一些自定义字段到你的注册过程,因为你正在使用官方laravel auth你可以添加你的领域: /resources/views/auth/register.blade.php

然后你可以validation并保存你的input: /app/Http/Controllers/Auth/RegisterController.php

你不需要在供应商的registeruser中添加任何东西,因为你添加的每一个东西都会在每个composer php安装或更新之后改变和replace。