app/Http/Controllers/CustomerController.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)
    {
        $data = request()->validate([
            'nama' => 'required|string|max:120',
            'no_telepon' => 'required|string|max:20',
            'address' => 'required|string|max:190',
        ]);
        Customer::create($data);
        return redirect()->route('customer.index')->with('success', 'Data Customer berhasil dimasukan');
    }
public function store ( Request $ request ) { $ data = request ( ) -> validate ( [ 'nama' => 'required|string|max:120' , 'no_telepon' => 'required|string|max:20' , 'address' => 'required|string|max:190' , ] ) ; Customer :: create ( $ data ) ; return redirect ( ) -> route ( 'customer.index' ) -> with ( 'success' , 'Data Customer berhasil dimasukan' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .