Código
<?php namespace App; use Illuminate\Auth\Authenticatable; use Illuminate\Database\Eloquent\Model; use Illuminate\Auth\Passwords\CanResetPassword; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; class Usuario extends Model implements AuthenticatableContract{ use Authenticatable; protected $table = 'usuario'; public $fillable = ['ID_USUARIO','email','NOMBRE','APELLIDO','password','REPITE_PASS']; protected $hidden = ['password']; public $timestamps =false; }
formulario de login
Código
<html> <body> @section('sidebar') @show <div id="formulario"> {!! Form::open(array('url' => 'usuarios/ingresar' , 'method'=>'POST')) !!} {!! Form::label('ingrese su email')!!} {!! Form::email('email')!!}</br> {!! Form::label('ingrese su password')!!} {!! Form::password('password')!!}</br> {!! Form::submit('enviar')!!} {!! Form::close()!!} </div> </body> </html>
UsuariosController es el controlador
Código
public function store(Request $request) { if (Auth::attempt(['email'=>$request->email , 'password'=>$request->password])) { return Redirect::to('biblioteca'); } return Redirect::to('usuarios/ingresar'); }
y las rutas
Código
Mod: Dudas sobre PHP van al subforo de PHP. Utilizar etiquetas GeSHi.