MINI MINI MANI MO
<?php
namespace App\Http\Controllers;
use App\Models\CddIniciativas;
use App\Models\Decretos;
use App\Models\DocumentosInformativos;
use Illuminate\Http\Request;
class IniciativasController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$arc = DocumentosInformativos::where('tipo','2')->first();
$iniciativas = CddIniciativas::where('categoria','Iniciativa')->orderby('folio','desc')->get();
return view("pages.iniciativas.index",compact('iniciativas','arc'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$iniciativa = CddIniciativas::find(base64_decode(base64_decode($id)));
return view("pages.iniciativas.iniciativa", compact("iniciativa"));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
public function decretosIniciativas()
{
$arc = DocumentosInformativos::where('tipo','5')->first();
$iniciativas = Decretos::where('num_decreto', '!=', ' ')->where('num_decreto', '!=', '0')
->groupBy('num_decreto')->orderbyRaw('num_decreto+0 asc')->with('iniciativa')->get();
// $iniciativas = CddIniciativas::where('categoria','Iniciativa')->with("decretos", function ($q) {
// $q->where('num_decreto', '!=', ' ')->where('num_decreto', '!=', '0')->groupBy('num_decreto')->orderBy('num_decreto','asc');
// })->get();
// dd($iniciativas);
return view("pages.iniciativas.decretos",compact('iniciativas','arc'));
}
}
OHA YOOOO