app/Http/Controllers/Backend/MyClassesController.php
/**
     * Update the specified resource in storage.
     *
     * @param int $id
     * @return Response
     */
Update the specified resource in storage.
@param int $id
@return Response
Update the specified resource in storage . @param int $id @return Response
public function update(Request $request)
    {
        try {
            $Classrooms = Classroom::findOrFail($request->id);
            $Classrooms->update([
                $Classrooms->Name_Class = ['ar' => $request->Name, 'en' => $request->Name_en],
                $Classrooms->Grade_id = $request->Grade_id,
            ]);
            toastr()->success(trans('messages.Update'));
            return redirect()->route('Classrooms.index');
        }
        catch
        (\Exception $e) {
            return redirect()->back()->withErrors(['error' => $e->getMessage()]);
        }
    }
public function update ( Request $ request ) { try { $ Classrooms = Classroom :: findOrFail ( $ request -> id ) ; $ Classrooms -> update ( [ $ Classrooms -> Name_Class = [ 'ar' => $ request -> Name , 'en' => $ request -> Name_en ] , $ Classrooms -> Grade_id = $ request -> Grade_id , ] ) ; toastr ( ) -> success ( trans ( 'messages.Update' ) ) ; return redirect ( ) -> route ( 'Classrooms.index' ) ; } catch ( \ Exception $ e ) { return redirect ( ) -> back ( ) -> withErrors ( [ 'error' => $ e -> getMessage ( ) ] ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .