1
- <<<<<<< HEAD
2
1
<x-app-layout :title =" __('pages/auth.register.page_title')" >
3
2
<x-container class =" py-12 sm:py-16 lg:pt-20" >
4
3
<div class =" lg:grid lg:gap-12 lg:grid-cols-2" >
136
135
</x-container >
137
136
138
137
<x-join-sponsors :title =" __('global.sponsor_thanks')" />
139
- </x-app-layout >
140
- =======
141
- <?php
142
-
143
- use App\Models\ User ;
144
- use Illuminate\Auth\Events\ Registered ;
145
- use Illuminate\Support\Facades\ Auth ;
146
- use Illuminate\Support\Facades\ Hash ;
147
- use Illuminate\Validation\ Rules ;
148
- use Livewire\Attributes\ Layout ;
149
- use Livewire\Volt\ Component ;
150
-
151
- new # [Layout('layouts.guest')] class extends Component
152
- {
153
- public string $name = ' ' ;
154
- public string $email = ' ' ;
155
- public string $username = ' ' ;
156
- public string $password = ' ' ;
157
- public string $password_confirmation = ' ' ;
158
-
159
- public function register (): void
160
- {
161
- $validated = $this -> validate ([
162
- ' name' => [' required' , ' string' , ' max:255' ],
163
- ' email' => [' required' , ' string' , ' lowercase' , ' email' , ' max:255' , ' unique:' . User:: class ],
164
- ' username' => [' required' , ' string' , ' max:255' , ' unique:' . User:: class ],
165
- ' password' => [' required' , ' string' , ' confirmed' , Rules \Password:: defaults ()],
166
- ]);
167
-
168
- $validated [' password' ] = Hash:: make ($validated [' password' ]);
169
-
170
- event (new Registered ($user = User:: create ($validated )));
171
-
172
- Auth:: login ($user );
173
-
174
- $this -> redirect (route (' dashboard' ), navigate : true );
175
- }
176
- };
177
- ? >
178
-
179
- {{-- <x-app-layout :title="__('pages/auth.register.page_title')"> --}}
180
- <div >
181
- <x-container class =" py-12 sm:py-16 lg:pt-20" >
182
- <div class =" lg:grid lg:gap-12 lg:grid-cols-2" >
183
- <div class =" hidden items-center justify-center lg:flex" >
184
- <div >
185
- <h3 class =" text-lg font-semibold leading-6 text-gray-700 dark:text-gray-300" >
186
- {{ __ (' pages/auth.register.advantages.heading' ) } }
187
- </h3 >
188
- <dl class =" mt-10 grid gap-6 grid-cols-2" >
189
- <x-site-feature
190
- :title =" __('pages/auth.register.advantages.podcast')"
191
- :description =" __('pages/auth.register.advantages.podcast_description')"
192
- >
193
- <x-slot:icon >
194
- <x-icon .podcast class =" size-8" aria-hidden =" true" />
195
- </x-slot:icon >
196
- </x-site-feature >
197
-
198
- <!-- Autres éléments de fonctionnalité ici... -->
199
-
200
- </dl >
201
- </div >
202
- </div >
203
-
204
- <div class =" mx-auto max-w-md space-y-8" >
205
- <div class =" space-y-3 text-center" >
206
- <h2 class =" font-heading text-3xl font-extrabold text-gray-900 dark:text-white" >
207
- {{ __ (' pages/auth.register.join_us' ) } }
208
- </h2 >
209
- <x-profile-users />
210
- <p class =" leading-6 text-gray-500 dark:text-gray-400" >
211
- {{ __ (' pages/auth.register.joins_description' ) } }
212
- </p >
213
- </div >
214
-
215
- <div >
216
- <x-status-message />
217
-
218
- <form wire:submit.prevent =" register" class =" space-y-6" >
219
- @csrf
220
- <div class =" space-y-3" >
221
- <!-- Name Input -->
222
- <div class =" space-y-1" >
223
- <label for =" name" class =" block text-sm font-medium text-gray-700 dark:text-gray-300" >
224
- {{ __ (' validation.attributes.name' ) } }
225
- </label >
226
- <input
227
- type =" text"
228
- id =" name"
229
- wire:model.defer =" name"
230
- name =" name"
231
- required
232
- class =" block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
233
- placeholder =" {{ __ (' validation.attributes.name' ) } }"
234
- />
235
- @error (' name' ) <span class =" text-sm text-red-500" >{{ $message } } </span > @enderror
236
- </div >
237
-
238
- <!-- Email Input -->
239
- <div class =" space-y-1" >
240
- <label for =" email" class =" block text-sm font-medium text-gray-700 dark:text-gray-300" >
241
- {{ __ (' validation.attributes.email' ) } }
242
- </label >
243
- <input
244
- type =" email"
245
- id =" email"
246
- wire:model.defer =" email"
247
- name =" email"
248
- required
249
- class =" block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
250
- placeholder =" {{ __ (' validation.attributes.email' ) } }"
251
- />
252
- @error (' email' ) <span class =" text-sm text-red-500" >{{ $message } } </span > @enderror
253
- </div >
254
-
255
- <!-- Username Input -->
256
- <div class =" space-y-1" >
257
- <label for =" username" class =" block text-sm font-medium text-gray-700 dark:text-gray-300" >
258
- {{ __ (' validation.attributes.username' ) } }
259
- </label >
260
- <input
261
- type =" text"
262
- id =" username"
263
- wire:model.defer =" username"
264
- name =" username"
265
- required
266
- class =" block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
267
- placeholder =" {{ __ (' validation.attributes.username' ) } }"
268
- />
269
- @error (' username' ) <span class =" text-sm text-red-500" >{{ $message } } </span > @enderror
270
- </div >
271
-
272
- <!-- Password Input -->
273
- <div class =" space-y-1" >
274
- <label for =" password" class =" block text-sm font-medium text-gray-700 dark:text-gray-300" >
275
- {{ __ (' validation.attributes.password' ) } }
276
- </label >
277
- <input
278
- type =" password"
279
- id =" password"
280
- wire:model.defer =" password"
281
- name =" password"
282
- required
283
- class =" block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
284
- placeholder =" {{ __ (' pages/auth.register.password_placeholder' ) } }"
285
- />
286
- @error (' password' ) <span class =" text-sm text-red-500" >{{ $message } } </span > @enderror
287
- </div >
288
-
289
- <!-- Password Confirmation Input -->
290
- <div class =" space-y-1" >
291
- <label for =" password_confirmation" class =" block text-sm font-medium text-gray-700 dark:text-gray-300" >
292
- {{ __ (' validation.attributes.password_confirmation' ) } }
293
- </label >
294
- <input
295
- type =" password"
296
- id =" password_confirmation"
297
- wire:model.defer =" password_confirmation"
298
- name =" password_confirmation"
299
- required
300
- class =" block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
301
- placeholder =" {{ __ (' pages/auth.register.password_confirm_placeholder' ) } }"
302
- />
303
- @error (' password_confirmation' ) <span class =" text-sm text-red-500" >{{ $message } } </span > @enderror
304
- </div >
305
- </div >
306
-
307
- <div >
308
- <x-buttons .primary type =" submit" class =" group w-full relative" >
309
- <span class =" absolute inset-y-0 left-0 flex items-center pl-3" >
310
- <x-untitledui-lock class =" size-5 text-green-500 group-hover:text-green-600" aria-hidden =" true" />
311
- </span >
312
- {{ __ (' pages/auth.register.submit' ) } }
313
- </x-buttons .primary >
314
- </div >
315
- </form >
316
- </div >
317
-
318
- @include (' partials._socials-link' )
319
- </div >
320
- </div >
321
- </x-container >
322
-
323
-
324
- <x-join-sponsors :title =" __('global.sponsor_thanks')" />
325
- </div >
326
- {{-- </x-app-layout> --}}
327
- >>>>>>> c512f79 (feat: (LAR-77) Mise en place de la class Login, et correction de la connexion)
138
+ </x-app-layout >
0 commit comments