File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed
Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class DividaDoClienteController extends Controller
1414 public function add ()
1515 {
1616 $ this ->request ()->validate ([
17- 'divida_do_cliente_id ' => 'required ' ,
17+ 'divida_id ' => 'required ' ,
1818 'cliente_id ' => 'required '
1919 ]);
2020
@@ -26,7 +26,7 @@ public function add()
2626 {
2727 foreach ($ cliente ->dividas () as $ div )
2828 {
29- if ($ div ->id == $ this ->request ()->input ('divida_do_cliente_id ' ))
29+ if ($ div ->id == $ this ->request ()->input ('divida_id ' ))
3030 {
3131 $ hasDivida = true ;
3232 }
@@ -46,7 +46,7 @@ public function add()
4646 public function store ()
4747 {
4848 $ divida_do_cliente = new DividaDoCliente ;
49- $ divida_do_cliente ->divida_id = $ this ->request ()->input ('divida_do_cliente_id ' );
49+ $ divida_do_cliente ->divida_id = $ this ->request ()->input ('divida_id ' );
5050 $ divida_do_cliente ->cliente_id = $ this ->request ()->input ('cliente_id ' );
5151 $ divida_do_cliente ->save ();
5252
Original file line number Diff line number Diff line change 6868 <label for="divida_do_cliente">
6969 Dívidas
7070 <br>
71- <select name="divida_do_cliente_id " id="divida_do_cliente" class="form-control">
71+ <select name="divida_id " id="divida_do_cliente" class="form-control">
7272 <?php
7373 foreach ($ dividas as $ divida )
7474 {
Original file line number Diff line number Diff line change 3737<h3>Devedores</h3>
3838
3939<div class="container-fluid">
40+
41+ <div class="row">
42+ <div class="col-md-12 box">
43+ <form method="POST" action="<?php route ('/dividasdocliente/add/ ' ); ?> ">
44+ <input type="hidden" name="_token" value="<?php token (); ?> ">
45+
46+ <label for="divida_do_cliente">
47+ Clientes
48+ <br>
49+ <select name="cliente_id" id="divida_do_cliente" class="form-control">
50+ <?php
51+ foreach ($ clientes as $ cliente )
52+ {
53+ echo '<option value=" ' .$ cliente ->id .'"> ' .$ cliente ->id .'. ' .$ cliente ->nome .'</option> ' ;
54+ }
55+ ?>
56+ </select>
57+
58+ <input type="hidden" name="divida_id" value="<?php echo $ divida ->id ; ?> ">
59+
60+
61+ </label>
62+
63+
64+ <input type="submit" class="btn btn-primary" value="Adicionar Cliente">
65+ </form>
66+ </div>
67+ </div>
68+ <br>
4069 <div class="row">
4170 <div class="col-md-12">
4271 <div class="table-responsive">
You can’t perform that action at this time.
0 commit comments