Create user ready

This commit is contained in:
Александр Бабкин
2022-06-24 12:47:49 +03:00
parent 5c51767351
commit a2f47d1ba7
6 changed files with 133 additions and 7 deletions

View File

@@ -0,0 +1,67 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Create user') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
<form method="POST" action="{{ route('users.store') }}">
@csrf
<!-- User name -->
<div>
<x-label for="username" :value="__('User name')" />
<x-input id="username" class="block mt-1 w-full" type="text" name="username" :value="old('username')" required autofocus />
</div>
<!-- Name -->
<div>
<x-label for="name" :value="__('Name')" />
<x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus />
</div>
<!-- Email Address -->
<div class="mt-4">
<x-label for="email" :value="__('Email')" />
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
</div>
<!-- Email Address -->
<div class="mt-4">
<x-label for="email" :value="__('Email')" />
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
</div>
<!-- Password -->
<div class="mt-4">
<x-label for="password" :value="__('Password')" />
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
</div>
<!-- Confirm Password -->
<div class="mt-4">
<x-label for="password_confirmation" :value="__('Confirm Password')" />
<x-input id="password_confirmation" class="block mt-1 w-full" type="password" name="password_confirmation" required />
</div>
<div class="flex items-center justify-end mt-4">
<x-button class="ml-4">
{{ __('Register') }}
</x-button>
</div>
</form>
</div>
</div>
</div>
</div>
</x-app-layout>

View File

@@ -1,7 +1,7 @@
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Users') }}
{{ __('User list') }}
</h2>
</x-slot>
@@ -9,9 +9,36 @@
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
User list must be here!!!
<a href="{{ route('users.create')}}">
<x-button class="m-2">{{__('Create user')}}</x-button>
</a>
<div align="center">
<table class="table table-sm border-b border-gray-200">
<tr class="border border-gray-200">
<th class="p-2 border border-gray-200">
{{ __('User name')}}
</th>
<th class="p-2 border border-gray-200">
{{ __('Email')}}
</th>
<th class="p-2 border border-gray-200">
{{ __('Actions')}}
</th>
</tr>
@foreach ( $users as $user)
<tr class="border border-gray-200">
<td class="p-2 border border-gray-200">{{ $user->username }}</td>
<td class="p-2 border border-gray-200">{{ $user->email }}</td>
<td class="p-2 border border-gray-200">&nbsp;</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
</div>
</x-app-layout>
</x-app-layout>