示例#1
0
*/
use App\Doglove\Mascota\MascotaRepo;
use App\Doglove\Mascota\Raza;
use App\Doglove\Mascota\WebServices;
use App\Modelos2\DetallePedido;
use App\Jobs\Send;
use App\Modelos2\Pedido;
use App\Modelos2\Producto;
use Illuminate\Http\Response;
use Illuminate\Http\Request;
use App\Modelos2\Usuarios;
use App\Modelos\Veterinaria;
use App\Modelos\Match;
//login
Route::get('testing1', function (Request $request) {
    $producto = Producto::findOrFail(1);
    return $producto->stock;
});
Route::get('dulcereal/login', function (Request $request) {
    return View::make('dulcereal.login');
});
Route::post('dulcereal/login', function (Request $request) {
    $email = $request->input('email');
    $password = $request->input('password');
    $usuario = Usuarios::where('email', $email)->where('password', $password)->first();
    if ($usuario) {
        //usuario normal
        if ($usuario->estado == 1) {
            return redirect('../hacerpedido');
        } else {
            //usuario admin
示例#2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Request $request, $id)
 {
     Producto::findOrFail($id)->update($request->all());
     return Response::json($request->all());
 }