<?php

namespace App\Http\Controllers;

use App\Models\Categories;
use Illuminate\Http\Request;
use DB;
class CategoriesController extends Controller
{
   public function APICategoriasListar(){
      
       $data = DB::select("CALL pro_categorias_listar();");
       return $data;

   }


   public function WebCategoriesList(){
       $data = DB::select("CALL pro_categorias_listar();");

             return view('backend.categories.index',['data'=>  $data]);

   }


   public function WebCategoriesFormAdd(){
     

             return view('backend.categories.add') ;

   }


   public function WebCategoriesFormEdit($cid){
     
              $data = Categories::find($cid);
             return view('backend.categories.edit',['data'=>$data]) ;

   }


   public function WebCategoriesSave($cid){
     
              $data = Categories::find($cid);
             return view('backend.categories.edit',['data'=>$data]) ;

   }


}
