app/Http/Controllers/EmployeeController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $employees = Employee::find($id);
        if(!$employees) {
            return redirect()->route('employees.index')->withErrors('Вы не можете редактировать данный пост')
                ->withErrors('Ты куда-то не туда пошел');
        }
        $employees->name_employee = $request->name_employee;
        $employees->email = $request->email;
        $employees->update();
        return redirect()->route('employees.index')->with('success', 'Пост успешно отредактирован');
    }
public function update ( Request $ request , $ id ) { $ employees = Employee :: find ( $ id ) ; if ( ! $ employees ) { return redirect ( ) -> route ( 'employees.index' ) -> withErrors ( 'Вы не можете редактировать данный пост') -> withErrors ( 'Ты куда-то не туда пошел'); } $ employees -> name_employee = $ request -> name_employee ; $ employees -> email = $ request -> email ; $ employees -> update ( ) ; return redirect ( ) -> route ( 'employees.index' ) -> with ( 'success' , 'Пост успешно отредактирован'); }
Update the specified resource in storage.
Update the specified resource in storage .