Commit cd03d70e authored by Lucas Henrique's avatar Lucas Henrique
Browse files

Adiciona remoção dos campos de avaliação

parent 41f68936
...@@ -636,6 +636,7 @@ class EventoController extends Controller ...@@ -636,6 +636,7 @@ class EventoController extends Controller
$comissao = ComissaoEvento::where('eventosId', $id); $comissao = ComissaoEvento::where('eventosId', $id);
$revisores = Revisor::where('eventoId', $id); $revisores = Revisor::where('eventoId', $id);
$trabalhos = Trabalho::where('evento_id', $id); $trabalhos = Trabalho::where('evento_id', $id);
$camposAvaliacao = CampoAvaliacao::where('evento_id', $id);
// if(isset($areas)){ // if(isset($areas)){
// $areas->delete(); // $areas->delete();
...@@ -653,6 +654,10 @@ class EventoController extends Controller ...@@ -653,6 +654,10 @@ class EventoController extends Controller
$trabalhos->delete(); $trabalhos->delete();
Trabalho::withTrashed()->where('evento_id', $id)->update(['evento_id' => null]); Trabalho::withTrashed()->where('evento_id', $id)->update(['evento_id' => null]);
} }
if(isset($camposAvaliacao)){
$camposAvaliacao->delete();
CampoAvaliacao::withTrashed()->where('evento_id', $id)->update(['evento_id' => null]);
}
Storage::deleteDirectory('pdfEdital/' . $evento->id ); Storage::deleteDirectory('pdfEdital/' . $evento->id );
Storage::deleteDirectory('modeloDocumento/' . $evento->id); Storage::deleteDirectory('modeloDocumento/' . $evento->id);
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddSoftdeleteCamposAvaliacao extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('campo_avaliacaos', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('campo_avaliacaos', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableCampoAvaliacaos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('campo_avaliacaos', function (Blueprint $table) {
$table->integer('evento_id')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
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