app/Http/Controllers/Dashboard/EmpolyeeController.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)
    {
        $post= Employee::find($id);
        $post->emp_name=$request->emp_name;
        $post->national_num=$request->national_num;
        $post->adress=$request->adress;
        $post->phone=$request->phone;
        $Employee= $post->save();
        notify_msg('success','تم التعديل بنجاح');
        return redirect('admin/employees/create');
    }
public function update ( Request $ request , $ id ) { $ post = Employee :: find ( $ id ) ; $ post -> emp_name = $ request -> emp_name ; $ post -> national_num = $ request -> national_num ; $ post -> adress = $ request -> adress ; $ post -> phone = $ request -> phone ; $ Employee = $ post -> save ( ) ; notify_msg ( 'success' , 'تم التعديل بنجاح'); return redirect ( 'admin/employees/create' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
/*
$Employee=DB::table('employees')->get();
        //$Employee=Employee::create($request_data);
        if($request->emp_type == 1)
        {
            $request_data=$request->except(['password','permission']);
            $request_data['password']=Hash::make($request->password);
            $request_data['employee_id']=$Employee->id;
            $request_data['email']=$request->email;
            $request_data['name']=$request->emp_name;
            $user=User::create($request_data);
           $user->attachRole('super_admin'); /// super_admin
          // $user->syncPermissions($request->permission);
        }else if($request->emp_type == 2){
            $request_data=$request->except(['password','permission']);
            $request_data['password']=Hash::make($request->password);
            $request_data['employee_id']=$Employee->id;
            $request_data['name']=$Employee->emp_name;
            $request_data['email']=$request->email;

            $user=User::create($request_data);
           $user->attachRole('admin'); /// super_admin
          // $user->syncPermissions($request->permission);
}*/