form validations
This commit is contained in:
parent
cdcfd485ef
commit
e5c98e6535
@ -11,8 +11,14 @@ class SignupController extends Controller
|
||||
return view("auth.signup");
|
||||
}
|
||||
|
||||
public function store()
|
||||
public function store(Request $request)
|
||||
{
|
||||
dd("Post...");
|
||||
// Validate the request...
|
||||
$request->validate([
|
||||
"name" => "required|max:16",
|
||||
"username" => "required|unique:users|min:3|max:16",
|
||||
"email" => "required|unique:users|email|max:64",
|
||||
"password" => "required|min:8|max:64",
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -15,32 +15,54 @@
|
||||
<div class="mb-5">
|
||||
<label for="name" class="mb-2 block uppercase text-gray-500 font-bold">Name</label>
|
||||
<input id="name" name="name" type="text" placeholder="Enter your name"
|
||||
class="border p-3 w-full rounded-lg">
|
||||
class="border p-3 w-full rounded-lg @error('name')border-red-500 @enderror"
|
||||
value="{{ old('name') }}">
|
||||
|
||||
@error('name')
|
||||
<p class="bg-red-500 text-white my-2 rounded-lg text-sm p-2 text-center">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<label for="username" class="mb-2 block uppercase text-gray-500 font-bold">Username</label>
|
||||
<input id="username" name="username" type="text" placeholder="Enter your username"
|
||||
class="border p-3 w-full rounded-lg">
|
||||
class="border p-3 w-full rounded-lg @error('username')border-red-500 @enderror">
|
||||
|
||||
@error('username')
|
||||
<p class="bg-red-500 text-white my-2 rounded-lg text-sm p-2 text-center">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<label for="email" class="mb-2 block uppercase text-gray-500 font-bold">E-Mail</label>
|
||||
<input id="email" name="email" type="email" placeholder="Enter your e-mail"
|
||||
class="border p-3 w-full rounded-lg">
|
||||
class="border p-3 w-full rounded-lg @error('email')border-red-500 @enderror">
|
||||
|
||||
@error('email')
|
||||
<p class="bg-red-500 text-white my-2 rounded-lg text-sm p-2 text-center">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<label for="password" class="mb-2 block uppercase text-gray-500 font-bold">Password</label>
|
||||
<input id="password" name="password" type="password" placeholder="Enter your password"
|
||||
class="border p-3 w-full rounded-lg">
|
||||
class="border p-3 w-full rounded-lg @error('password')border-red-500 @enderror">
|
||||
|
||||
@error('password')
|
||||
<p class="bg-red-500 text-white my-2 rounded-lg text-sm p-2 text-center">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mb-5">
|
||||
<label for="password_confirmation" class="mb-2 block uppercase text-gray-500 font-bold">Confirm your
|
||||
password</label>
|
||||
<input id="password_confirmation" name="password_confirmation" type="password"
|
||||
placeholder="Confirm your password" class="border p-3 w-full rounded-lg">
|
||||
placeholder="Confirm your password"
|
||||
class="border p-3 w-full rounded-lg @error('password_confirmation')border-red-500 @enderror">
|
||||
|
||||
@error('password_confirmation')
|
||||
<p class="bg-red-500 text-white my-2 rounded-lg text-sm p-2 text-center">{{ $message }}</p>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Create Account"
|
||||
|
Loading…
x
Reference in New Issue
Block a user