Commit e23b8acb authored by Carlos André's avatar Carlos André
Browse files

ajustado o banco e os dados dos participantes

parent a0427e97
...@@ -33,6 +33,7 @@ use App\Mail\SubmissaoTrabalho; ...@@ -33,6 +33,7 @@ use App\Mail\SubmissaoTrabalho;
use App\Mail\EventoCriado; use App\Mail\EventoCriado;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use App\OutrasInfoParticipante;
class TrabalhoController extends Controller class TrabalhoController extends Controller
{ {
...@@ -61,7 +62,8 @@ class TrabalhoController extends Controller ...@@ -61,7 +62,8 @@ class TrabalhoController extends Controller
'edital' => $edital, 'edital' => $edital,
'grandeAreas' => $grandeAreas, 'grandeAreas' => $grandeAreas,
'funcaoParticipantes'=> $funcaoParticipantes, 'funcaoParticipantes'=> $funcaoParticipantes,
'rascunho' => $rascunho 'rascunho' => $rascunho,
'enum_turno' => OutrasInfoParticipante::ENUM_TURNO
]); ]);
} }
......
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class OutrasInfoParticipante extends Model
{
protected $fillable = ['name', 'user_id', 'trabalho_id', 'participante_id'];
public const ENUM_TURNO = ['Matutino', 'Vespertino', 'Noturno', 'Integral'];
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\OutrasInfoParticipante;
class CreateOutrasInfoParticipantesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('outras_info_participantes', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string("rg");
$table->date("data_de_nascimento");
$table->string("curso");
$table->enum("turno", OutrasInfoParticipante::ENUM_TURNO)->nullable(true);
$table->integer("ordem_prioridade")->nullable(true);
$table->string("periodo_atual")->nullable(true);
$table->string("total_periodos")->nullable(true);
$table->double("media_do_curso", 3, 2)->nullable(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('outras_info_participantes');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddColumnParticipante extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('participantes', function (Blueprint $table) {
$table->unsignedBigInteger('outras_info_participante_id')->nullable(true);
$table->foreign('outras_info_participante_id')->references('id')->on('outras_info_participantes');
});
}
/**
* 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