Matching gebruikers met elkaar

stemmen
0

voer

Hoe kan ik dat op te klikken submit knop, overeenkomen met de gebruikers met elkaar, zoals Geheime Kerstman regels? Je moet niet de kerstman van jezelf, en je moet niet de kerstman van iemand die al uw Kerstman. Daarna ga ik filter met user->groups(Tags afgebeeld op de foto)

Dit is mijn .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

En dit is mijn 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']),
        ]);
    }

}
De vraag is gesteld op 02/12/2019 om 23:58
bron van user
In andere talen...                            


1 antwoorden

Matching gebruikers met elkaar

stemmen
0

voer image beschrijving hier

Hoe kan ik dat op te klikken submit knop, overeenkomen met de gebruikers met elkaar, zoals "Geheime Kerstman" regels? Je moet niet de kerstman van jezelf, en je moet niet de kerstman van iemand die al uw Kerstman. Daarna ga ik filter met user->groups(Tags afgebeeld op de foto)

Dit is mijn .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

En dit is mijn 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']),
        ]);
    }

}
antwoordde op 02/12/2019 om 23:58
bron van user

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