app/Http/Controllers/TableController.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)
    {
        $request->validate([
            'no_meja' => 'required',
        ],
        [
            'no_meja.required' => 'jangan kosongkan no meja anda',
        ]
    );
        TableModel::create([
            'number' => $request->no_meja,
            'status_table' => $request->status_meja
        ]);
        return redirect('/table')->with('status', 'data berhasil ditambahkan');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'no_meja' => 'required' , ] , [ 'no_meja.required' => 'jangan kosongkan no meja anda' , ] ) ; TableModel :: create ( [ 'number' => $ request -> no_meja , 'status_table' => $ request -> status_meja ] ) ; return redirect ( '/table' ) -> with ( 'status' , 'data berhasil ditambahkan' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
//validasi //return $request;