app/Http/Controllers/RjoController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Rjo  $rjo
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Rjo $rjo)
    {
        $data = request()->validate([
            'customer_id' => 'required|exists:customer,id',
            'unit_code' => 'required|integer',  
            'part_name' => 'required|string',
            'problem' => 'required|string',
            'job_desc' => 'required|string',
            'date_received' => 'required|date',
            'date_request' => 'required|date',
        ]);
        $data['marketing_id'] = Auth::user()->marketing->id;
        $rjo->update($data);
        return redirect()->route('rjo.index')->with('success', 'Data R.J.O berhasil diubah');
    }
public function update ( Request $ request , Rjo $ rjo ) { $ data = request ( ) -> validate ( [ 'customer_id' => 'required|exists:customer,id' , 'unit_code' => 'required|integer' , 'part_name' => 'required|string' , 'problem' => 'required|string' , 'job_desc' => 'required|string' , 'date_received' => 'required|date' , 'date_request' => 'required|date' , ] ) ; $ data [ 'marketing_id' ] = Auth :: user ( ) -> marketing -> id ; $ rjo -> update ( $ data ) ; return redirect ( ) -> route ( 'rjo.index' ) -> with ( 'success' , 'Data R.J.O berhasil diubah' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .