File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ class HomeController extends Controller
1616 */
1717 public function index ()
1818 {
19+ $ this ->createCL ();
20+
1921 return view ('welcome ' , [
2022 'haircuts ' => Haircuts::all ()->toArray () ?? [],
2123 'works ' => Works::with ('client ' )->with ('haircut ' )->get ()->toArray () ?? [],
@@ -25,7 +27,7 @@ public function index()
2527 public function create ()
2628 {
2729
28- $ this -> createCL ( );
30+ $ hair = Haircuts:: firstWhere ( ' id ' , request ()-> get ( ' haircut_id ' ) );
2931
3032 $ client = Clients::where ([
3133 ['first_name ' , request ()->get ('first_name ' )],
@@ -34,10 +36,13 @@ public function create()
3436 ])->first ();
3537
3638 if (!$ client ) {
39+
40+
3741 $ client = Clients::create ([
3842 'first_name ' => request ()->get ('first_name ' ),
3943 'second_name ' => request ()->get ('second_name ' ),
4044 'third_name ' => request ()->get ('third_name ' ),
45+ 'sex ' => $ hair ->sex ,
4146 ]);
4247
4348 $ client ->save ();
You can’t perform that action at this time.
0 commit comments