Passende Benutzer miteinander

stimmen
0

Geben

Wie kann ich sicherstellen , dass Submit - Button auf klicken, wird der Benutzer wie „Wichteln“ Regeln miteinander, Vorstellungen? Sie sollten nicht Sankt von sich selbst, und Sie sollten nicht Sankt von jemanden, der schon ist Ihre Sankt. Danach habe ich werde Filter mit bin user->groups(Tags gezeigt auf Foto)

Das ist meine .blade.php:

@extends('layouts.app')
@section('content')
<div class=container>
    <div class=row justify-content-center>
        <div class=col-md-8>
            <div class=card>
                <div class=card-header>{{ __('List') }}</div>
                <div class=card-body>
                    <form action=>
                 @foreach($users as $user)
                    <div class=users-list style=padding: 5px 0>
                    <h5>{{ $user->name }}</h5>
                        <p class=badge badge-primary>{{ $user->group }}</p>
                    </div>
                @endforeach
                <input class=btn btn-primary w-100 type=submit value=Submit>
            </form>

                </div>
        </div>
    </div>
</div>
@endsection

Und das ist meine RegisterController.php:

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return \App\User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'group' => $data['group'],
            'wish' => $data['wish'],
            'password' => Hash::make($data['password']),
        ]);
    }

}
Veröffentlicht am 02/12/2019 um 23:58
quelle vom benutzer
In anderen Sprachen...                            


1 antworten

Passende Benutzer miteinander

stimmen
0

Geben Sie hier image description

Wie kann ich sicherstellen , dass Submit - Button auf klicken, wird der Benutzer wie „Wichteln“ Regeln miteinander, Vorstellungen? Sie sollten nicht Sankt von sich selbst, und Sie sollten nicht Sankt von jemanden, der schon ist Ihre Sankt. Danach habe ich werde Filter mit bin user->groups(Tags gezeigt auf Foto)

Das ist meine .blade.php:

@extends('layouts.app')
@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">{{ __('List') }}</div>
                <div class="card-body">
                    <form action="">
                 @foreach($users as $user)
                    <div class="users-list" style="padding: 5px 0">
                    <h5>{{ $user->name }}</h5>
                        <p class="badge badge-primary">{{ $user->group }}</p>
                    </div>
                @endforeach
                <input class="btn btn-primary w-100" type="submit" value="Submit">
            </form>

                </div>
        </div>
    </div>
</div>
@endsection

Und das ist meine RegisterController.php:

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;

class RegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = '/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return \App\User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'group' => $data['group'],
            'wish' => $data['wish'],
            'password' => Hash::make($data['password']),
        ]);
    }

}
Beantwortet am 02/12/2019 um 23:58
quelle vom benutzer

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more