Commit 04a775ec authored by Guilherme Silva's avatar Guilherme Silva
Browse files

Mudanças na forma de criação da documentação complementar

parent 743a0f82
......@@ -17,9 +17,10 @@ class DocumentacaoComplementarController extends Controller
$docComp = DocumentacaoComplementar::find($request->docId);
}else{
$docComp = new DocumentacaoComplementar;
$docComp->save();
}
$pasta = 'docComplementar/' . Auth::user()->id;
$pasta = 'docComplementar/' . $docComp->id;
$docComp->termoCompromisso = Storage::putFileAs($pasta, $request->termoCompromisso, "Termo De Compromisso.pdf");
$docComp->comprovanteMatricula = Storage::putFileAs($pasta, $request->comprovanteMatricula, "Comprovante De Matricula.pdf");
......@@ -27,11 +28,9 @@ class DocumentacaoComplementarController extends Controller
$docComp->termoCompromisso = Storage::putFileAs($pasta, $request->termoCompromisso, "TermoDeCompromisso.pdf");
$docComp->participante_id = $request->partcipanteId;
$docComp->linkLattes = $request->linkLattes;
if($request->docId != null){
$docComp->update();
}else{
$docComp->save();
}
$docComp->update();
return redirect()->back()->with(['sucesso' => "Documentação complementar enviada com sucesso"]);
......
......@@ -15,10 +15,10 @@ class CreateDocumentacaoComplementarsTable extends Migration
{
Schema::create('documentacao_complementars', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('termoCompromisso');
$table->string('comprovanteMatricula');
$table->string('pdfLattes');
$table->string('linkLattes');
$table->string('termoCompromisso')->nullable();
$table->string('comprovanteMatricula')->nullable();
$table->string('pdfLattes')->nullable();
$table->string('linkLattes')->nullable();
$table->integer('participante_id')->nullable();
$table->foreign('participante_id')->references('id')->on('participantes');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment