<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class LineController extends Controller
{
    public function selectLine(Request $request)
    {
        if(!$request->ajax()) return view('/');

        $lineas = DB::table('lineas')
                            ->select('id as linea_id','cantidad','descripcion','obs','estado')
                            ->where('estado','1')
                            ->orderBy('descripcion','asc')
                            ->get();
        return response()->json($lineas);
    }

    public function ComboSelectLine(Request $request){
        if(!$request->ajax()) return view('/');

        $lineas = DB::table('lineas')
                            ->select('id as linea_id','cantidad','descripcion','obs','estado')
                            ->where('estado','1')
                            ->orderBy('descripcion','asc')
                            ->get();
        return response()->json($lineas);
    }
}
