app/Http/Controllers/API/VotuongController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $user = User::find($request->id);
        $nhanvat = Nhanvat::create([
            "name" => $request->name,
            "user_id" => $request->id
        ]);
        return view('home', compact('nhanvat'));
    }
public function store ( Request $ request ) { $ user = User :: find ( $ request -> id ) ; $ nhanvat = Nhanvat :: create ( [ " name " => $ request -> name , " user_id " => $ request -> id ] ) ; return view ( 'home' , compact ( 'nhanvat' ) ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .