public function createdModel($model) { $recaudos = Recaudo::all(); $recaudos->each(function ($recaudo) use($model) { $recFicha = new RecaudosFicha(); $recFicha->ficha()->associate($model); $recFicha->recaudo()->associate($recaudo); $recFicha->save(); }); Bitacora::registrar('Se registró la ficha.', $model->id); }
public function getDescargar($recaudoFichaId) { $recaudo = RecaudosFicha::findOrFail($recaudoFichaId); $path = storage_path('adjuntos' . DIRECTORY_SEPARATOR . $recaudo->ficha_id . DIRECTORY_SEPARATOR . $recaudo->documento); return Response::download($path); }