1
Good afternoon to you all. I created a Migration "clients" in the Newsletter that receives 3 foreign keys from the entities: modalities, requests and locals.
In my view when registering a client and viewing in phpmyadmin I see that all data is saved with their respective names, but in this table clients, the columns modes, orders and locals are saved only the id.
For example:
In the mode select the user chooses the first select item which is Special.
In the order select the user chooses the second select item which is Varied.
In the locals select the user chooses the third select item which is São Paulo.
If I go there in phpmyadmin to see how it was in the register will be in these columns respectively: 1, 2 and 3.
Is it so or am I doing something wrong so the name is not appearing?
My customers are like this:
$table->increments('id');
$table->string('nome_cliente',80);
$table->string('email_cliente',80)->unique();
$table->string('endereco',50);
$table->string('situacao',20);
$table->integer('modalidade_id')->unsigned();
$table->foreign('modalidade_id')->references('id')->on('modalidades');
$table->integer('pedido_id')->unsigned();
$table->foreign('pedido_id')->references('id')->on('pedidos');
$table->integer('locals_id')->unsigned();
$table->foreign('locals_id')->references('id')->on('locals');
$table->softDeletes();
$table->timestamps();
That’s correct, relationships should be made only with ID even, when you are listing the orders and in this listing display the user name is only you do an INNER JOIN.
– Kayo Bruno
Okay, so in my bank you’ll be showing up the ID instead of the name?
– Tom Viana
That’s right, man.
– Kayo Bruno