app/Http/Controllers/OtController.php
/**
   * Display a listing of the resource.
   *
   * @return \Illuminate\Http\Response
   */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index()
   {
      $ots= Ot::orderBy('created_at', 'ASC')->get();
      $ots = Ot::with('cliente','usuario','estado')->where('estado',1)->get();
      return response()->json($ots);
   }
public function index ( ) { $ ots = Ot :: orderBy ( 'created_at' , 'ASC' ) -> get ( ) ; $ ots = Ot :: with ( 'cliente' , 'usuario' , 'estado' ) -> where ( 'estado' , 1 ) -> get ( ) ; return response ( ) -> json ( $ ots ) ; }
Display a listing of the resource.
Display a listing of the resource .