I'm trying to make a server laravel, the idea is that given an email address and a password, you can search elusuario in the database and if there's one answer me with json. My problem is I do not know if I'm doing well
My code:
Model
Class Usuario extends Eloquent{
protected $table = 'Usuario';
}
UsuarioController
class UsuarioController extends BaseController{
public function buscarUsuario($Correo, $Contraseña){
$usuario = Usuario::find($Correo,$Contraseña)->toJson();
return View::make('usuario.lista', array('usuario' => $usuario));
}
}
lista.blade.php(view/usuario)
{{$usuario}}
routes.php
Route::get('usuario/{Correo}/{Contraseña}', array('uses' => 'UsuarioController@buscarUsuario'));
I also would like to know, how can I send values ls URL to see if the JSON works well?