Help with view in laravel 5.4

0

Good evening friends I have a small problem and I do not know how to solve it, the problem is the following I have a table called transaction which is responsible for recording all transactions that occur in my application is this:

where by means of the transaccion_tipo_id field it tells me if it is a purchase or sale that table is this:

well up there all my problem lies in how I do so that a single view is responsible for registering a transaction is the type that is if I do not have a model of purchase or a sale and therefore no driver to send information to that view, the purpose of the transaction table is precisely to avoid having a table for each type of transaction.

So far I have only created the transaction model but I have no idea how to solve the proposed problem thanks in advance.

    
asked by Camilo Villegas 12.12.2017 в 00:50
source

1 answer

0

Good afternoon!

As far as I could understand, you want the different transactions to be managed with a single form.

For this you could have a select where visually the different transactions would be seen but the transaction id would be sent from behind. That is:

 <select>
  <option value="1">Venta</option>
  <option value="2">Compra</option>
  <option value="3">Ingreso</option>
  <option value="4">Salida</option>
</select> 
    
answered by 12.12.2017 в 18:11