Pengaturan

Gambar

Lainnya

Tentang KASKUS

Pusat Bantuan

Hubungi Kami

KASKUS Plus

© 2024 KASKUS, PT Darta Media Indonesia. All rights reserved

blogertegalAvatar border
TS
blogertegal
~ask~ error login laravel
Route
Code:

Route::get('/login', 'user@login');
Route:/:p/ost('/login', 'user@loginPr');


Controler
Code:

public function login(){
return View::make('login');

}
public function loginPr(){
$validator = Validator::make(
Input::all(),
array(
"username" => "required",
"password" => "required"
)
);

if($validator->passes())
{
$verifikasi = array('userName' => Input::get('email'), 'pass' => Hash::make(Input::get('password')));
if (Auth::attempt($verifikasi)) {
echo "Success";
}
else{
echo "Error";
}
}
else
{
return Redirect::to('login')
->withErrors($validator)
->withInput();
}
}


Form Login
Code:
<!DOCTYPE html>
<html>
<head>
<title>Register</title>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" type="text/css" href="<?php echo asset('css/bootstrap.min.css') ?>" />

</head>
<body style="width:80%;margin:40px auto">
<div class="units-container">

<form method="post" action="" class="forms">
<h1>Form Registrasi</h1>
<table>
<tr>
<td>Username</td>
<td width = "20" align="center">:</td>
<td><input type="text" name="username" value="<?php echo Form:/:o/ld('username') ?>" class="form-control" maxlength="100" />
<span class="error"><?php echo $errors->first('username') ?></span></td>
</tr>
<tr>
<td>Password</td>
<td width = "20" align="center">:</td>
<td><input type="password" name="password" value="<?php echo Form:/:o/ld('password') ?>" class="form-control" maxlength="100" />
<span class="error"><?php echo $errors->first('password') ?></span></td>
</tr>
<tr>
<td colspan="3" align="center"><input type="submit" class="btn btn-primary" value="Register"></td>
</tr>
</table>
</form>
</div>
</body>
</html>

Eror
BadMethodCallException
Method [newQuery] does not exist.
0
611
0
GuestAvatar border
Komentar yang asik ya
Mari bergabung, dapatkan informasi dan teman baru!
Website, Webmaster, Webdeveloper
Website, Webmaster, WebdeveloperKASKUS Official
23.3KThread4.4KAnggota
GuestAvatar border
Komentar yang asik ya
Ikuti KASKUS di
© 2023 KASKUS, PT Darta Media Indonesia. All rights reserved.