public function getColegio() { $user = User::fromToken(); $years = Year::all(); foreach ($years as $year) { $year->periodos = Periodo::where('year_id', $year->id)->get(); } $certif = ConfigCertificado::all(); $imagenes = ImageModel::where('user_id', $user->user_id)->where('publica', true)->get(); $result = ['years' => $years, 'certificados' => $certif, 'imagenes' => $imagenes]; return $result; }
public function getIndex() { $user = User::fromToken(); $certificados = ConfigCertificado::all(); return $certificados; }