2
I have a table with columns id
, nome
, descricao
and tipo
. In my Request I have:
'nome' => 'required|unique:edificacoes'
So far so good, I can not register anything with the same name, but as I would not be able to register with the same name only also be the same type?
Ex: I have the record 01 | NomeTeste | Tipo1
, if I try to register 02 | NomeTeste | Tipo2
I can’t. How can I make him check the name and type to block only if the 2 are equal?
Table creation:
Schema::create('edificacoes', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('id');
$table->longText('nome');
$table->longText('descricao')->nullable();
$table->char('tipo', 4);
$table->timestamps();
});
Could post the complete table structure, please?
– Marco Aurélio Deleu
Posted, @Marcoauréliodeleu
– Raylan Soares